469,898 Members | 1,755 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

C# Roate image problem in a windows form

Okay so I want to rotate an image. However the rotate command is doing nothing. I've tried this with both JPEG and Bitmap images.

I just have a button and a picturebox. When i click the button the picturebox should rotate 90 degrees, however it does not do anything at all. Here is the code for the thing:

I tried it this way:
pictureBox1.Image.RotateFlip(System.Drawing.Rotate FlipType.Rotate90FlipNone);

and this way:
pictureBox1.Image.RotateFlip(RotateFlipType.Rotate 90FlipNone);

Both do nothing. The program runs fine though, no errors.

Any reason for this? Or is there another way to rotate an image?
Dec 22 '07 #1
2 1948
Mr E
2
"pictureBox1.Image.RotateFlip(RotateFlipType.Rotat e 90FlipNone);"

I don't see why that doesn't work, try putting a breakpoint on that line of code to make sure it is being run.
Dec 22 '07 #2
Ok so when I put this code:

#if DEBUG
System.Diagnostics.Debugger.Break();
#endif

I also ran this just in case it needed to be like this:

#if DEBUG
pictureBox1.Image.RotateFlip(RotateFlipType.Rotate 90FlipNone);

System.Diagnostics.Debugger.Break();
#endif

which I think is a breakpoint code, and run it in the debug mode it shows that it gets to the part of the code. I does stop responding after hit the button and the breakpoint code is run.

Is there a possibility of a form property that may be hindering the working of that command?
Dec 22 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Jeff Griffin | last post: by
2 posts views Thread by Don Tucker | last post: by
10 posts views Thread by Adam Honek | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.