背景图片有问题 [英] Problem with images over backgrounds

查看:77
本文介绍了背景图片有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以胜利形式在背景上放置一个选中标记位图(.bmp),但是由于选中标记不是矩形,因此白色修剪会妨碍背景.我不希望这种情况发生,有什么办法可以仅通过代码消除这种修整.也许我可以将白色设置为透明,但是我不知道该怎么做,即使有可能.

I''m trying to put a check-mark bitmap(.bmp) over a background in a win form, but as the check-mark''s is not a rectangle the white trim gets in the way of the background. I don''t want that to happen is there any way I can eliminate that trim just with code. Maybe I could set the color white to transparent but I don''t know how to do that, or even if it''s possible. Maybe someone out there knows.

推荐答案

BMP图像是位图,并且不包含任何透明度信息.尝试改用PNG文件(您最喜欢的图像编辑程序将告诉您如何制作透明背景).

如果必须使用位图,则必须自己绘制复选标记,并定义将要绘制的位图区域-如果复选标记不只是由一个角度的两个笔划组成,这将很复杂.可能看起来不太好,因为边缘将非常清晰地定义,而不是平滑和锯齿.

我几乎所有小图像都使用PNG文件-透明度只是位图的优点之一!

[edit]错字-尝试"的类型"-OriginalGriff [/edit]
BMP images are bitmaps, and do not contain any transparency information. Try using a PNG file instead (you favourite image editing program will tell you how to do transparent backgrounds).

If you must use a bitmap, then you will have to draw the check mark yourself, and define a region of the bitmap which will be drawn - this is complex if the check mark is not just comprised of two strokes at an angle, and will probably not look too good as the edges will be very sharply defined, rather than smooth and aliased.

I use PNG files for nearly all my small images - the transparency is just one of the advantages over bitmaps!

[edit]Typo - "type" for "try" - OriginalGriff[/edit]


这篇关于背景图片有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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