How to rotate Bitmap in windows GDI?

前端 未结 3 1087
日久生厌
日久生厌 2021-01-02 02:55

How would I go about rotating a Bitmap in Windows GDI,C++?

3条回答
  •  太阳男子
    2021-01-02 03:01

    Sounds like you have to use PlgBlt. Take your rectangle's 4 corners as 2D Points, rotate them, then call PlgBlt.

    From MSDN Bitmap Rotation:

    To copy a bitmap into a parallelogram; use the PlgBlt function, which performs a bit-block transfer from a rectangle in a source device context into a parallelogram in a destination device context. To rotate the bitmap, an application must provide the coordinates, in world units, to be used for the corners of the parallelogram.

提交回复
热议问题