Name

image — A way to import images

Synopsis

LZX: image
JavaScript: 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 var lastloaded : String;
The last URL loaded by this image tag. Used to prevent the same URL from loading twice. @keywords readonly
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.

Methods (1)

loadNow()
<method name="loadNow" args="img" />
public function loadNow(img);
Loads an image in response to the src attribute being set. Should not be called directly - setAttribute('src' ...) shoudl be used instead. @keywords private

LZX Synopsis

<class name="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="" />
  <method name=" loadNow " args="img" />
</class>

JavaScript Synopsis

public image extends  LzView  {
  public var forcereload  : Boolean;
  public var lastloaded  : String;
  public var prefix  : String;
  public var src  : String;
  prototype public function loadNow (img);
}