Rotate image

Answered
1
1

I have a PictureBox p and I tried to call p.Image.RotateFlip(RotateFlipType.Rotate90FlipNone) with no efect.

How can I rotate an image?

And how can I allow user to zoom +/- an image?

 

  • You must to post comments
Best Answer
0
1

Hi Adrian,

I send you in attachment the way to proceed.

Best,

Kevin(ITG)

  • You must to post comments
0
1

Hi Adrian,

If you want to use Wisej for rotation, we have an extender https://docs.wisej.com/docs/controls/extenders/rotation for that:

– For Rotation : this.rotation1.GetRotation(this.pictureBox1).RotateZ += 20;

-For Scale (Zoom) : this.rotation1.GetRotation(this.pictureBox1).ScaleX += 20;this.rotation1.GetRotation(this.pictureBox1).ScaleY += 20; this.rotation1.GetRotation(this.pictureBox1).ScaleZ += 20;

If you want to apply effect directly on Bitmap, Check this link for more details https://docs.microsoft.com/en-us/dotnet/api/system.drawing.image.rotateflip?view=dotnet-plat-ext-6.0

Happy Coding,

Kevin(ITG)

  • Adrian Zagar
    Hi Kevin, As stated, I tried directly on bitmap with RotateFlip(RotateFlipType.Rotate90FlipNone) . The same code works correctly on winform. I tried several options (separate Bitmap variable where I apply RotateFlip or directly on myPictureBox.Image. No errors, but nothing happens. Any idea? I managed to make it work with: Bitmap b = new Bitmap(p.Image); b.RotateFlip(RotateFlipType.Rotate90FlipNone); p.Image = b; I still don’t understand why p.RotateFlip(RotateFlipType.Rotate90FlipNone); is not working.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.