updateImage Method

Summary

Update the HTML Image Element of an item.

Syntax

JavaScript Syntax
ImageViewerItems.prototype.updateImage = function(item, image, resolution) 
TypeScript Syntax
updateImage(item: ImageViewerItem, image: HTMLImageElement, resolution: LeadSizeD): void; 

Parameters

item

Item to update

image

New HTML Image Element. If this is null, then the item will be empty after this method returns.

resolution

The resolution to use of the image in dots/inch (or DPI). A value of 0,0 or Empty means use the default image

resolution which is 96 pixels.

Remarks

This method is a shortcut for updating the Image and Resolution properties. It is equivalent to:

item.image = image; 
item.resolution = resolution; 

UpdateElement is a shortcut for updating not only Image, but also Element and Canvas. Passing a valid HTML Image Element to UpdateElement sets the Image property just as UpdateImage does. Similarly, passing a valid HTML5 Canvas Element to UpdateElement sets the Canvas property just as UpdateCanvas does. The item can have a value in only one of Image, Element or Canvas. Setting one value will automatically delete the values of the others.

Example

JavaScript Example
var img = new Image(200, 200); 
this._imageViewer.items.updateImage(this._imageViewer.activeItem, img, lt.LeadSizeD.create(96, 96)); 

Requirements

Target Platforms

Help Version 19.0.2017.10.18
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls Assembly