We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

exporting image to particular location in printdocument

Hi,

how can i export image to a particular location in printdocument object so that my desire image comes at specific location.

1 Reply

AD Administrator Syncfusion Team September 21, 2007 07:16 AM UTC

Hi ,

By using DrawImage method of Printpage.Graphics it is possible to place the image in a desired location in the PrintDocument object.We can use PrintPage event of PrintDocument object to achieve this.Here is the code snippets:

void printDoc_PrintPage(object sender, PrintPageEventArgs e)
{
System.Drawing.Point p = new Point(100,50);
System.Drawing.Point p1 = new Point(500,500);
System.Drawing.RectangleF r= new RectangleF();
r.Height=50;
r.Width=50;
System.Drawing.RectangleF r1 = new RectangleF();
r1.Offset(p);
r1.Height = 75;
r1.Width = 75;
System.Drawing.RectangleF r2 = new RectangleF();
r2.Offset(p1);
r2.Height = 75;
r2.Width = 50;
System.Drawing.Image img = Printing.Resource1.Winter;
e.Graphics.DrawImage(img, r);
e.Graphics.DrawImage(img, r1);
e.Graphics.DrawImage(img, r2);
}


Please refer the following sample that illustrate this:
http://websamples.syncfusion.com/samples/Diagram.Windows/F68394/main.htm

Please try this and let me know if you have any questions.

Regards,
Jisha

Loader.
Live Chat Icon For mobile
Up arrow icon