<image>
A way to import images

JavaScript: lz.image
extends <view> » <node> » lz.Eventable »

Example 45. image

<canvas debug="true">
                <dataset name="imagedata">
                    <image url="http://www.openlaszlo.org/images/horses/horse-1-sm.jpg"/>
                </dataset>
            
                <wrappinglayout/>
                <image src="http://www.openlaszlo.org/images/horses/horse-1-sm.jpg"/>
                <image datapath="imagedata:/image/@url"/>
                <image prefix="http://www.openlaszlo.org/images/horses/" src="horse-1-sm.jpg"/>
                <image src="http://www.openlaszlo.org/images/horses/horse-1-sm.jpg"/>
                <image>
                    <text>Click me</text>
                    <handler name="onclick">
                        this.setAttribute('src', 'http://www.openlaszlo.org/images/horses/horse-1-sm.jpg');
                    </handler>
                </image>
                <image forcereload="true">
                    <text>Click me to reload</text>
                    <handler name="onclick">
                        this.setAttribute('src', 'http://www.openlaszlo.org/images/horses/horse-1-sm.jpg');
                    </handler>
                </image>
            </canvas>

image represents an image that can be loaded at runtime, either by specifying a URL directly or by binding to data

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
forcereload boolean boolean false read/write
  If true, the same URL will be reloaded. If false, the same URL will not load multiple times.
lastloaded string String   readonly
  The last URL loaded by this image tag. Used to prevent the same URL from loading twice.
prefix string String   read/write
  an optional prefix URL to load from. If specified, the url will be appended to this prefix.
src string String   read/write
  The URL to load the image from. May be set directly on this attribute or indirectly by specifying a datapath for this tag.

Methods

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Name Description
onsrc  

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy