Image controls can be used to display images such like png, jpg or gif.
Just pass the file path and you're done.
Without the width and height dimensions the image will be shown without any scaling.
If you specify one of them and leave the other null, -1 or blank, it will be scaled so that the aspect ratio is kept.
And if you specify both parameters it will be scaled to your wishes.
If you want images to depress like buttons if touched you can use the
Drawing on Images
Images are also useful for drawing basic shapes and other images on it and therefore for creating dynamic animations or even basic games. To create an empty image you can pass null as file parameter.
This way you can also specify a fixed pixel size to the image you can use the
img.DrawLine( 0, 0, 1, 1 );
If you dislike the anti-alias effect you can apply the
img2.DrawImage( img, 0, 0, 1, 1, 0 );
There are a whole bunch of drawing methods defined here. Some of the were already used above. You can draw lines, rectangles, circles and other images, just to name a few. You can even draw a transformed image using an transformation matrix. Check out the Draw* methods in the method list below to get more details about all drawing functions.
Drawing on Images fast
If you have many draw operations to perform at runtime (ie. for games) you might want to disable the automatic canvas update after each Draw* call using the SetAutoUpdate method. To force the rendering now, you have to call Update.
Another way to increase the animation speed is using the NoDom configuration. This will disable html and js Dom elements in your app that consume a lot of resources, but app functions can still be used.
For animations you can then use the Animate function of the app object which calls a function for a given amount per second. Note that the canvas still needs some time to refresh - so going over 60 fps makes no sense at all.
Properties
The following properties are available on the Image object:
Methods
The following methods are available on the Image object: