Represents class for image component. This component may be also used as standalone component, but it is used within other components too.
Determine whether image is completely loaded.
property Ready: Boolean read getReady;
Specifies address (path) of loaded image.
property Url: String read getSrc write setSrc;
If URL differ from currently loaded image, LoadFromURL method will be called in order to load new image.
Start loading image from address.
procedure LoadFromURL(aURL: String);
- Remote or local path to image.
To load image from your local resources sub-folder, write:
W3Image1.LoadFromURL('res/my_image.jpg'); // notice res/ part.
If image is successfully loaded, OnLoad event will occur. At that point is safe to do further actions with your image.
Returns a string representing the canvas image (by calling datatoDataURL DOM method).
function toDataUrl: String;
Example partial output:
Returns TW3ImageData representation of Image.
function ToImageData: TW3ImageData;
TW3ImageData object provide access to the individual pixels of image.
Occurs after image set via LoadFromURL method is fully loaded (Handle is allocated and size is set).
property OnLoad: TNotifyEvent read FOnLoad write _setOnLoad;