60000079 Export Drawing to BMP

Article 60000079
Type HowTo
Product Engine
Version 6
Date Added 3/15/2007 12:00:00 AM
Fixed (3/15/2007 12:00:00 AM)
Submitted by Raymond Toh


I cannot find any samples which can show me how to export a drawing to BMP. I found a method rendertographics but do not know how to use it. In previous version ( version 5.0 ), I did it successfully, but the method used seems totally changed.


In a new project add a vdFramedControl, a picturebox  (this is optional) and a button and a code like :

Dim selset As VectorDraw.Professional.vdCollections.vdSelection
selset = VdFramedControl1.BaseControl.ActiveDocument.Selections.FindName(
Dim a As VectorDraw.Geometry.Box|
a = selset.GetBoundingBox
PictureBox1.Width = 200 ' exported image will be 200x200 pixels
PictureBox1.Height = 200
Dim img1 As Image
img1 =
New Bitmap(PictureBox1.Width, PictureBox1.Height)
Dim graph As System.Drawing.Graphics
graph = Graphics.FromImage(img1)

VdFramedControl1.BaseControl.ActiveDocument.ActiveLayOut.RenderToGraphics(graph, a, img1.Width, img1.Height)
img1.Save("C:\_temp\aaaaa.bmp", System.Drawing.Imaging.ImageFormat.Bmp) 'save to disk
PictureBox1.Image = img1 ' show in form's Picture box

Send comments on this topic.