How to rotate png image Delphi?

后端 未结 1 1234
旧巷少年郎
旧巷少年郎 2021-01-14 20:44

How can I rotate a png image in Delphi with preserving its transparency? I loaded it via TPNGObject. I\'m then using Canvas.StretchDraw(MyRect, the TPNGOb

1条回答
  •  一整个雨季
    2021-01-14 21:23

    The problem is that if you do a rotate using the Canvas, you will lose your transparency, as you noted with TPNGObject.

    This is because the Canvas doesn't support transparency at the level required by a PNG image.

    Instead, you must use specialized code to rotate the PNG image. Here is a link to a library of code that supports the TPNGObject, including a function to rotate it: http://cc.embarcadero.com/Item/25631

    0 讨论(0)
提交回复
热议问题