Documentation in progress: please use the 3.4 Reference Manual.

Name

image — A way to import images

Synopsis

LZX: image
JavaScript: lz.image
Type: Class
Access: public
Topic: Components.Base Components
Declared in: lps/components/base/image.lzx

Description

Example 32. 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

Superclass Chain

node (LzNode) » view (LzView) » image

Known Subclasses

Details

Properties (4)

forcereload
<attribute name="forcereload" type="boolean" value="false" />
public var forcereload : boolean;
If true, the same URL will be reloaded. If false, the same URL will not load multiple times.
lastloaded
<attribute name="lastloaded" type="string" value="" />
public read-only var lastloaded : String;
The last URL loaded by this image tag. Used to prevent the same URL from loading twice.
prefix
<attribute name="prefix" type="string" value="" />
public var prefix : String;
an optional prefix URL to load from. If specified, the url will be appended to this prefix.
src
<attribute name="src" type="string" value="" />
public var src : String;
The URL to load the image from. May be set directly on this attribute or indirectly by specifying a datapath for this tag.

Events (1)

onsrc
<attribute name="onsrc" />
public event onsrc;

LZX Synopsis

<class name="lz.image" extends=" LzView ">
  <attribute name=" forcereload " type="boolean" value="false" />
  <attribute name=" lastloaded " type="string" value="" />
  <attribute name=" prefix " type="string" value="" />
  <attribute name=" src " type="string" value="" />
  <event name=" onsrc " />
</class>

JavaScript Synopsis

public lz.image extends  LzView  {
  public var forcereload  : boolean;
  public read-only var lastloaded  : String;
  public var prefix  : String;
  public var src  : String;
  prototype public event onsrc ;
}