如何根据PNG图像使表单透明? [英] How can I make a form transparent according to a PNG image?

查看:320
本文介绍了如何根据PNG图像使表单透明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用透明度的PNG图像(实际上是一个具有渐变效果的圆形,从中间的黑色到边缘透明)。我使用 TImage 将其放在表单上。我将 TForm1.Color TForm1.TransparentColorValue 设置为相同的值, TForm1.TransparentColor := true



现在,当我运行程序时,图像的渐变部分以窗体的颜色显示。我正在寻找的是使用透明的形式效果来实现PNG图像的透明度。



我做错了什么?
我正在使用Delphi 2010试用版。

解决方案

我怀疑你正在尝试创建像透明的 splashscreen ,如果是这样,你可以阅读这些伟大的文章,他们描述了一个很好的方式来使用透明png以delphi形式。





再见。


I have a PNG image that uses transparency (it is actually a circle with gradient effect from black in the middle, to transparent on the margins). I am putting this on a form using TImage. I set TForm1.Color and the TForm1.TransparentColorValue to the same value and TForm1.TransparentColor:=true.

Now, when I run the program the gradient part of the image is displayed with the color of the form. What I am looking for is to enable the transparency of the PNG image using the transparent form effect.

What am I doing wrong? I am using Delphi 2010 Trial.

解决方案

I suspect you're trying to create something like a transparent splashscreen, if that's the case, you can read these great articles, they describes a nice way to use a transparent png in a delphi form.

Bye.

这篇关于如何根据PNG图像使表单透明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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