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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

exporting image to particular location in printdocument

Thread ID:

Created:

Updated:

Platform:

Replies:

68394 Sep 20,2007 06:40 AM UTC Sep 21,2007 07:16 AM UTC Windows Forms 1
loading
Tags: Diagram
Abacusoft
Asked On September 20, 2007 06:40 AM UTC

Hi,

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

CONFIRMATION

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.

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

;