Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | draw.ID.load SEARCH    

  Functions
draw.ID.brushFrom.ID
draw.ID.copyFrom.ID
draw.ID.copyMode
draw.ID.ellipse
draw.ID.getPixel
draw.ID.height
draw.ID.isEgual.ID
draw.ID.line
draw.ID.load
draw.ID.paint
draw.ID.pixelFormat
draw.ID.polygon
draw.ID.rect
draw.ID.rotate.sourceID
draw.ID.save
draw.ID.setPixel
draw.ID.size
draw.ID.text.ex
draw.ID.text.ex.getWidth
draw.ID.width
draw.isEgual.X
draw.isEgual.Y
draw.mem.create
draw.mem.createFromFile
draw.mem.delete
draw.mem.exists
draw.mx.deform
draw.mx.effects

  MioScript Reference
> Statements
app...
browser...
dialog...
disk...
draw...
extern...
filename...
keyboard...
menu...
mio...
mouse...
num...
path...
pushButton...
reg...
RS232...
sci...
screen...
shortcut...
sound...
str...
system...
time...
var...
window...

Function
draw.ID.load

Language: MioScript
Product: MioFactory


Syntax

draw.ID.load(Filename, X, Y, IcoSize)


Parameters

STRINGFilenameImage filename.
INTX, YOptional.
Where to draw the image in the target bitmap.
INTIcoSizeOptional.
Icon file only.
16: load a 16x16 pixels, 16 colors icon,
32: load a 32x32 pixels, 16 colors icon.


Return value

Size of the image



Description

Load an image from disk.

Supported formats are BMP and JPG.
Limited support of ICO files (single format, 16 colors, 16x16 or 32x32 pixels only).




MioScript Sample Code

// load an image in an internal cache and
// draw it in the main window 

&myImage = draw.mem.create()

draw.&myImage.load(path.desktop("myImage.jpg"))
draw.main.copyFrom.&myImage(null, null, null, null, 100, 100)

draw.main.paint()


// The following code do the same using the function loadImage:

&myImage = loadImage(path.desktop("myImage.jpg"))
draw.main.copyFrom.&myImage(null, null, null, null, 100, 100)

draw.main.paint()


// Or with no cache...

draw.main.load(path.desktop("myImage.jpg"), 100, 100)

draw.main.paint()


// If you want to retreive the size...

&imgSize = draw.main.load(
    path.desktop("myImage.jpg"),
    100, 100
)

alert("The size of the image is "&imgSize[0]" x "&imgSize[1]" pixels")