delphi从imagelist中获取透明背景图片的方法
2008-10-07 14:05
826 查看
Bitmap:= TBitmap.Create();
Bitmap.TransparentMode := tmFixed; //必须在getBitmap前设置
Bitmap.Transparent := True;
if (ImageList.GetBitmap(SubMenu.Tag, Bitmap)) then
begin
Bitmap.TransparentColor := Bitmap.Canvas.Pixels[0, 0]; //必须在getBitmap后设置
end;
如上代码,必须先设置Bitmap.TransparentMode := tmFixed; ,再GetBitmap获取图片后再设置Bitmap.TransparentColor才可以透明。GetBitmap之后再设置TransparentMode不管用。
没时间管它了,有时间和兴趣时可以看看GetBitmap调用的DoDraw函数是不是作了什么手脚。
Bitmap.TransparentMode := tmFixed; //必须在getBitmap前设置
Bitmap.Transparent := True;
if (ImageList.GetBitmap(SubMenu.Tag, Bitmap)) then
begin
Bitmap.TransparentColor := Bitmap.Canvas.Pixels[0, 0]; //必须在getBitmap后设置
end;
如上代码,必须先设置Bitmap.TransparentMode := tmFixed; ,再GetBitmap获取图片后再设置Bitmap.TransparentColor才可以透明。GetBitmap之后再设置TransparentMode不管用。
没时间管它了,有时间和兴趣时可以看看GetBitmap调用的DoDraw函数是不是作了什么手脚。
相关文章推荐
- 使用DD_belatedPNG让IE6支持PNG透明图片 及IE6下背景图闪烁问题的解决方法
- photoshop 输出切片成透明背景png图片方法
- android 从Imgeview中获取显示的图片不获取背景图片怎么获取,我用getDrawingCache()方法获取图片保存后背景图片也一起保存了。
- vc++加载透明png图片方法——GDI+和CImage两种 ,vs2005 vs2008 PNG背景
- IE6下PNG透明图片背景显示灰色的完美解决方法
- DevExpress 中 设置 labelControl 的背景透明到图片的方法
- vc++加载透明png图片方法——GDI+和CImage两种 ,vs2005 vs2008 PNG背景
- IE6显示png透明背景、图片的方法
- WebView设置透明和设置背景图片的方法
- 安卓开发学习之016 ImageView(二)图片的N种获取方法
- 【转】ie6下使PNG背景图片透明的方法
- 透明图片做背景和形状的方法swing
- Android Smart Image View使用方法--从url获取图片或从通讯录获取图片,支持缓存
- 解决IE6下PNG图片背景不透明的三种方法(CSS/JS/JQuery)
- 基于jQuery IE6下PNG图片背景透明问题解决方法
- 给TreeView设置背景图片-------即将TreeView的背景设为透明的方法
- IE6显示png透明背景、图片的方法
- ie6下使PNG背景图片透明的方法
- android网络上获取图片作为ImageButton和ImageView的背景
- 从Photoshop CS2中获得透明背景图片的方法