60000765 cmdImage to accept also a vdImage object

Article 60000765
Type Wish
Product Engine
Version 6014
Date Added 2/6/2009 12:00:00 AM
Fixed (2/6/2009 12:00:00 AM)
Submitted by Gareth Moore


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


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.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);

Send comments on this topic.