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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

exporting image to particular location in printdocument

Thread ID:





68394 Sep 20,2007 06:40 AM UTC Sep 21,2007 07:16 AM UTC WinForms 1
Tags: Diagram
Asked On September 20, 2007 06:40 AM UTC


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

Administrator [Syncfusion]
Replied On 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();
System.Drawing.RectangleF r1 = new RectangleF();
r1.Height = 75;
r1.Width = 75;
System.Drawing.RectangleF r2 = new RectangleF();
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:

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



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon