Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Image Rotation in C#

Image Rotation in C#

Scheduled Pinned Locked Moved C#
csharpgraphicshelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mmxguy
    wrote on last edited by
    #1

    Dear Sir/Madam, I'am trying to rotate an image in a picture box control in C#.Along with that i'am drawing a rectangle on to the image for highlighting certain parts of the image.While rotating the image is getting rotated properly but the drawing which i have made on the image is not getting rotated.I have tried with rotate and rotateat methods but they just rotate the drawing but not with respect to the image. My requirement is that while i'am rotating the image, the drawn rectangle highlighting certain parts also should get rotated and highlight the very same area in the rotated form. Kindly help me, Regards, mmx

    W H 2 Replies Last reply
    0
    • M mmxguy

      Dear Sir/Madam, I'am trying to rotate an image in a picture box control in C#.Along with that i'am drawing a rectangle on to the image for highlighting certain parts of the image.While rotating the image is getting rotated properly but the drawing which i have made on the image is not getting rotated.I have tried with rotate and rotateat methods but they just rotate the drawing but not with respect to the image. My requirement is that while i'am rotating the image, the drawn rectangle highlighting certain parts also should get rotated and highlight the very same area in the rotated form. Kindly help me, Regards, mmx

      W Offline
      W Offline
      wibblewibblewibble
      wrote on last edited by
      #2

      Have you created a Graphics object from the image? This will effectively draw on the image, so any post-processing should also apply to the drawings.

      M 1 Reply Last reply
      0
      • W wibblewibblewibble

        Have you created a Graphics object from the image? This will effectively draw on the image, so any post-processing should also apply to the drawings.

        M Offline
        M Offline
        mmxguy
        wrote on last edited by
        #3

        Drawing on the image is not the issue...That is done using the graphics object only...But while the image is rotated the drawings position is not changed or rotated.It lies in the same place...while image is rotated... Also while creating graphics from image an exception is popping 'coz it is saying "creating graphics object from image that has indexed pixel format is not possible " I need some mapping modes equivalent to MM_HIENGLISH,MM_HIMETRIC in VC++ in C#.NET...Also help me a bit with code... Kindly help me out Barry... Regards, MMX

        1 Reply Last reply
        0
        • M mmxguy

          Dear Sir/Madam, I'am trying to rotate an image in a picture box control in C#.Along with that i'am drawing a rectangle on to the image for highlighting certain parts of the image.While rotating the image is getting rotated properly but the drawing which i have made on the image is not getting rotated.I have tried with rotate and rotateat methods but they just rotate the drawing but not with respect to the image. My requirement is that while i'am rotating the image, the drawn rectangle highlighting certain parts also should get rotated and highlight the very same area in the rotated form. Kindly help me, Regards, mmx

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          A quick search for "image rotation" on CodeProject turns up several articles, including a pretty good one, Image Rotation in .NET[^].

          Microsoft MVP, Visual C# My Articles

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups