-
Notifications
You must be signed in to change notification settings - Fork 8
Image Widget
Marcus Mascord edited this page Jul 11, 2014
·
5 revisions
The image widget displays an image to the screen.
An image can be a PNG or JPG file. It is necessary to see if the image format used can be used on the particular OS. There are problems displaying JPG images on Windows Phone 8.
The attributes for the Image widget are the following:
Attributes | Type | Description |
---|---|---|
m | Widget | The main widget class. |
imageSrc | String | The filename of the image. |
image | Image | This stores the actual image once it has been loaded into memory. |
onLoad | Function | This is a callback function that is called once the image has been loaded into memory. The method signature is function() . |
clickAction | Function | This is a function that is called when a user taps on the image. The function signature is function(Image Widget, x position of user tap, y position of user tap)
|
preloadImage | Boolean | If this is set to true, the image will be preloaded into memory when the application is starting. This can be set to false for most devices, however for iOS devices if this is not set to true there may be a delay in drawing the image on the first screen draw. |
This is an example of the Image Widget written in XML:
<Widget>
<Class>Image</Class>
<PreLoadImage>True</PreLoadImage>
<Y>60</Y>
<AlignHoz>CENTER</AlignHoz>
<W>32</W>
<H>32</H>
<L>100</L>
<Src>images/my_image.png</Src>
</Widget>