Image rotation problem

bonedoc

Well-known member
Joined
May 4, 2006
Messages
112
Programming Experience
Beginner
I am making a print review that has an image in a rectangle, that I am rotating like this:

ImageR = New Rectanle(10,10,500,500)
mPicPrint.RorateFlip(RotateFlipType.RotateFlip90None)
e.Graphics.DrawImage(mPicPrint, ImageR)

In the print preview, it is rotated like it needs to be, but it is not rotated when it gets printed. What I am doing wrong?
 
When you create a print preview your printing code is executed. If the user then chooses to print your printing code is executed again. This means that the image will be rotated twice by the time it is printed. I'm guessing that your image is actually upside down as opposed to in its original orientation.

It is very important to realise that your printing code is executed twice when creating a preview because it means that you MUST reset any control variables, like page number, at the end of the printing code itself, rather than before you invoke the printing code. If you don't then the second run through will be using incorrect data. You might try rotating the image back again at the end of the print run, or else ritating it only once before the print run.
 
Back
Top