1
A
回答
4
您可以使用Bitmap类MakeTransparent方法。因此,这将是像
Bitmap b = new Bitmap("img.jpg")
b.MakeTransparent(Color.White);
pictureBox.Image = b;
但我建议你使用PNG而不是JPG这个原因:1)更好的质量(像这样的图像)C)更小的尺寸对于像本B图像)的原生支持透明背景。
看看它们之间有什么不同http://www.bing.com/search?setmkt=en-US&q=PNG+vs+JPG
1
尝试
Bitmap bmp = (Bitmap)Image.FromFile(@"C:\your_k.bmp"); //Load a bitmap from file
bmp.MakeTransparent(Color.White) //Do the work!
//if you have a varient color combination you can use RGB Combination as follows
//bmp.MakeTransparent(Color.FromArgb(255, 255 255)); // (255 255, 255) is white!
this.pictureBox1.Image = bmp;
this.pictureBox1.BackColor = Color.Transparent; //makes humbly only your object!
相关问题
- 1. 使JPG白色背景透明
- 2. 透明边框是白色
- 3. 如何仅使PDF邮票的白色部分透明?
- 4. 如何将PNG透明背景转换为JPG白色背景?
- 5. 将HTML的透明部分转换为Html2Canvas中的白色
- 6. 如何在iOS中更改部分透明图像的颜色?
- 7. 如何让背景图像的黑色部分透明?
- 8. ImageMagick,用不透明白色替换半透明白色
- 9. 透明部分的视图?
- 10. UIBarButtonItem图片的颜色/不透明度
- 11. UIImage的透明色为白色
- 12. 透明度着色器用透明色填充透明片段
- 13. sfThumbnailPlugin透明部分的黑色背景
- 14. 试图改变图像中的透明部分的颜色
- 15. flex瓦片列表透明图像显示白色背景
- 16. imageresizer透明白色png
- 17. Flex/Actionscript白色透明
- 18. CCRenderTexture(alpha)beginWithClear透明白色
- 19. 透明的图片框闪烁
- 20. c图片框上的透明按钮#
- 21. Android的透明图片不是透明
- 22. 将透明PNG转换为JPG时覆盖透明度颜色
- 23. 透明图片
- 24. 如何将UIImage中的颜色“白色”更改为透明
- 25. 透明IP分片
- 26. CSS3白色到透明的渐变
- 27. GD:使PNG透明的白色背景
- 28. 背景色透明显示为白色
- 29. 部分时间显示透明色
- 30. css渐变不透明幻灯片图像从左到右颜色白色