CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2019
    Posts
    53

    How to Rotate a Bitmap in WinAPI?

    Hi all,

    This is all way over my head...

    Any ideas how to rotate a bitmap by a specified angle in WinAPI?

    I was told to use SetWorldTransform() and an xForm structure.

    However, I'm not sure how to populate the xForm structure and SetWorldTransform apparently changes the characteristics of the Device Context on which it operates?

    Any ideas / sample code is welcome.

  2. #2
    Join Date
    May 2019
    Posts
    53

    Re: How to Rotate a Bitmap in WinAPI?

    Ok, so I've tried some mathematical transforms on the three (X, Y) coords required by the PlgBlt() function instead...

    Problem is, the origin of rotation seems to be stuck to (0,0) (The Upper-left corner of the window). When I rotate the sprite it rotates OFF the screen after 45 Degrees of rotation.

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured