Delphi如何旋转png图像?

发布于 2024-12-17 14:06:01 字数 131 浏览 1 评论 0原文

如何在 Delphi 中旋转 png 图像并保持其透明度? 我通过 TPNGObject 加载它。 然后我使用 Canvas.StretchDraw(MyRect, the TPNGObject) ,但我不知道如何旋转它。

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 TPNGObject) but I don't know how to rotate it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神爱温柔 2024-12-24 14:06:01

问题是,如果您使用 Canvas 进行旋转,您将失去透明度,正如您在 TPNGObject 中注意到的那样。

这是因为 Canvas 不支持 PNG 图像所需级别的透明度。

相反,您必须使用专门的代码来旋转 PNG 图像。以下是支持 TPNGObject 的代码库的链接,包括旋转它的函数:
http://cc.embarcadero.com/Item/25631

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文