如何旋转png图像Delphi? [英] How to rotate png image Delphi?

查看:232
本文介绍了如何旋转png图像Delphi?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Delphi中旋转png图像以保持其透明度?
我通过 TPNGObject 加载它。
然后我使用 Canvas.StretchDraw(MyRect,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.

推荐答案

问题是如果您使用Canvas进行旋转,那么您将失去透明度,就像您使用TPNGObject所指出的那样。

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

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

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

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

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

这篇关于如何旋转png图像Delphi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆