Rotating a Bitmap by an arbitrary angle
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Rotating a Bitmap by an arbitrary angle

  1. #1
    Join Date
    Jun 2001
    Location
    Melbourne/Aus (C# .Net 4.0)
    Posts
    686

    Rotating a Bitmap by an arbitrary angle

    Can anyone give me a pointer as to a good technique that can be used to display a rectangular Bitmap on a form rotated though an arbitray angle? (ie not necessarily 90,180,270 degrees).

    I know how to do the maths, I just need to know the process...

    Do I really need to copy the Bitmap into Memory and then transform it pixel by pixel? I'm hoping that I don't. I'm also hoping to avoid calling non-managed code (I've seen examples of how to do it in C/C++). I would like to do it all in C#.

    Any pointers appreciated. I'm sure someone here has done this before.
    Rob
    -
    Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......

  2. #2
    Join Date
    Jun 2001
    Location
    Melbourne/Aus (C# .Net 4.0)
    Posts
    686

    Re: Rotating a Bitmap by an arbitrary angle

    oops!! Seemed I just needed to RTFM. Will post the answer here when I have it.
    Rob
    -
    Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......

  3. #3
    Join Date
    Jan 2010
    Posts
    1,102

    Re: Rotating a Bitmap by an arbitrary angle


  4. #4
    Join Date
    Jun 2001
    Location
    Melbourne/Aus (C# .Net 4.0)
    Posts
    686

    Re: Rotating a Bitmap by an arbitrary angle

    Thanks, I'll check it out. I did find another example and managed to get it working. But I'll certainly compare it with this one....
    Rob
    -
    Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......

  5. #5
    Join Date
    Jan 2010
    Posts
    1,102

    Re: Rotating a Bitmap by an arbitrary angle

    OK.
    Would you like to share your approach here? Maybe you've used the transform matrix directly?

  6. #6
    Join Date
    Jun 2001
    Location
    Melbourne/Aus (C# .Net 4.0)
    Posts
    686

    Re: Rotating a Bitmap by an arbitrary angle

    I will soon, I'm still refactoring!!
    Rob
    -
    Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center