[英]How to rotate png image Delphi?
How can I rotate a png image in Delphi with preserving its transparency? 如何在Delphi中旋转png图像并保持其透明性? I loaded it via TPNGObject
. 我通过TPNGObject
加载了它。 I'm then using Canvas.StretchDraw(MyRect, the TPNGObject)
but I don't know how to rotate it. 然后,我正在使用Canvas.StretchDraw(MyRect, the TPNGObject)
但是我不知道如何旋转它。
The problem is that if you do a rotate using the Canvas, you will lose your transparency, as you noted with TPNGObject. 问题是,如果使用“画布”进行旋转,则会失去透明度,如TPNGObject所述。
This is because the Canvas doesn't support transparency at the level required by a PNG image. 这是因为“画布”不支持PNG图像所需的透明度。
Instead, you must use specialized code to rotate the PNG image. 相反,您必须使用专门的代码来旋转PNG图像。 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 这是指向支持TPNGObject的代码库的链接,其中包括旋转它的功能: http ://cc.embarcadero.com/Item/25631
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.