Prod.: Engine, ver.: 6014, ID: 60000765, Wish : cmdImage to accept also a vdImage object

Wish : cmdImage to accept also a vdImage object

Article60000765
TypeWish
ProductEngine
Version6014
Date Added2/6/2009
FixedYes [2/6/2009]
Submitted byGareth Moore
Keywords

Subject

cmdImage to accept also a vdImage object

Summary

Is it possible to have the cmdImage command to accept a vdImage object instead of a filename ?

Solution


A new command is added to the CommandAction in version 6015 like below :
/// <summary>
/// Inserts an image to the document.
/// </summary>
/// <param name="image">A vdImage Object that is not added to the Document and has already precreated the vdImageDef object and added to the Images collection.</param>
/// <param name="InsertionPoint">The insertion point(gPoint) or "USER",null so the user picks this point to the screen.</param>
/// <returns>True if the command was succesfull.</returns>
public bool CmdImage(vdImage image, object InsertionPoint)

C# example :
//Create the Image
VectorDraw.Professional.vdFigures.vdImage oneimage = new VectorDraw.Professional.vdFigures.vdImage();
oneimage.SetUnRegisterDocument(vdFramedControl.BaseControl.ActiveDocument);
oneimage.setDocumentDefaults();
oneimage.Width = 2.9;
//Create the Image Definition
oneimage.ImageDefinition = vdFramedControl.BaseControl.ActiveDocument.Images.Add("C:\\image.jpg");
//Run the command.
vdFramedControl.BaseControl.ActiveDocument.CommandAction.CmdImage(oneimage, null);