The Image Object

Image object is based on HTML <img> element.

var imgSample = new TImage('images/docs/Sunset.jpg', 200, 200);
var layHorizontal = new THorizontalLayout();
var wndImageSample = createWindow('Image Sample');

layHorizontal.add(imgSample);
wndImageSample.add(layHorizontal);
showModal(wndImageSample);

Image constructor takes four parameters:

new TImage(url, width, height, parent);

Image Methods and Properties
Method/Property Description
destroy Works as destructor for the image object
getElement Gets HTML img element that the image object is based on
getHeight Gets image object height
getUrl Gets image object URL
getWidth Gets image object width
setAttribute Sets HTML img element attributes. Form:
setAttribute(attributeName, attributeValue)
setCursor Sets mouse cursor style over the image object. Form:
setCursor(cursorStyle)
setHeight Sets image object height. Form: setHeight(height)
setWidth Sets image object width. Form: setWidth(width)
setUrl Sets image object URL