70001835 Export AddImageDefinition method with a loaded callback

Article 70001835
Type Wish
Product WebJS
Version 8005
Date Added 9/29/2020
Fixed 8.8006.0.2 (9/29/2020)
Submitted by VectorDraw Team

Summary

In version 8006.0.2 the method AddImageDefinition(string tablename, string urlpath, ImageLoadedDelegate imageloadedCallback) has been exported. Example: In the example we add a new Image Definition, we insert in by using the scriptCommand.image methodand aftet it has been inserted we zoom to the extents of the drawing. vdcanvas.AddImageDefinition("sampleImage", "sampleImage.png", function () { vdcanvas.scriptCommand.image("sampleImage", "sampleImage.png", [[0, 0, 0], 1.0, 0], actionentityaddedimg) }); function actionentityaddedimg(vdcanvas, entity) { vdcanvas.zoomExtents(); setTimeout(vdcanvas.redraw); //post a redraw command }

Solution

Send comments on this topic.