Printing and Save Image
Previous Topic  Next Topic 

 

Printing 

 

 

 

private void butPreview_Click(object sender, EventArgs e)

{

//   boundBox:

//     Bounding box in WCS that define the region in which will be output as an

//     image if specified. If Bounding Box is null the whole entities will be output

//     as an image.

//   In this example, we define a box that only contain a part of the whole drawing,

//   so only a part of the drawing will be save.

sdBox box = new sdBox(new Point3D(-10, -10, 0), new Point3D(30, 50, 0));

// Display Print preview form

draw.PrinterAtt.ShowPrintPreview(box);

}

 

private void butSelPrinter_Click(object sender, EventArgs e)

{

// Bring out the Printer Setup Dialog

if (draw.PrinterAtt.setupDlg.ShowDialog() == DialogResult.OK)

{

 

}            

}

 

 

 

Save Image

 

 

private void saveToolStripMenuItem_Click(object sender, EventArgs e)

{

//   boundBox:

//     Bounding box in WCS that define the region in which will be output as an

//     image if specified. If Bounding Box is null the whole entities will be output

//     as an image.

//   In this example, we define a box that only contain a part of the whole drawing,

//   so only a part of the drawing will be save.

sdBox box = new sdBox(new Point3D(-10, -10, 0), new Point3D(20, 34, 0));

              Image image = fDrawCtrl1.SaveImage(box, 800, 800);

image.Save("test.bmp");

}