gpt4 book ai didi

delphi - 使按钮字形在delphi 7中具有透明背景?

转载 作者:行者123 更新时间:2023-12-03 15:58:31 25 4
gpt4 key购买 nike

我有四个 TSpeedButton 对象,每个对象都有一个指定为按钮图像字形的 BMP 文件。无论出于何种原因,delphi 决定两个按钮图像应具有透明背景,两个按钮图像应具有白色背景。我自己创建了位图,因此它们都以相同的颜色深度保存,并使用纯白色(不是几乎白色的阴影)作为背景,并且在图像的所有四个角像素中都有背景颜色。

为什么有些字形图像会显示透明背景,而有些则不然?背景透明的标准是什么?如何使按钮图像全部具有透明背景而不是其中一半具有透明背景?

最佳答案

Ken's comment

Delphi's glyph handling uses the pixel in the lower-left corner to determine the transparent color. All pixels that match that color should be shown as transparent. Does the lower-left pixel color match in all of the glyphs, and does it match the areas you want to be transparent? (Without the images, it's hard to tell what the problem is, but I thought I'd post this as a potential for investigation.)

似乎持有正确答案(抱歉,无法接受评论作为正确答案!)。我使用的图像有一个阴影到达左下角,因此该角几乎是白色的,而所有其他角都是完全白色的。

关于delphi - 使按钮字形在delphi 7中具有透明背景?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9794107/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com