当前位置:首页 > 技术心得 > 正文内容

C#将图片白色背景设置为透明

xjtudll9年前 (2018-01-03)技术心得11710

红色部分是关键

Image image = System.Drawing.Image.FromFile(@"C:\A.JPG");

Bitmap pbitmap = new Bitmap(image);

pbitmap.MakeTransparent(Color.White);

pictureBox1.Image = pbitmap;

扫描二维码推送至手机访问。

版权声明:本文由鸟的天空发布,如需转载请注明出处。

本文链接:http://www.xjtudll.cn/Exp/486/

标签: C#
分享给朋友:

“C#将图片白色背景设置为透明” 的相关文章

Android的Service中弹出窗口解决方法

参考资料: http://www.cnblogs.com/fbsk/archive/2011/12/28/2304523.html http://blog.csdn.net/djun100/article/details/23756681 问题: 我们在使用Service时,经常会碰到这样的情况,比...

PHP Fatal error: Call to undefined function bindtextdomain() in ……

PHP Fatal error: Call to undefined function bindtextdomain() in ……

问题: PHP网站上传后,一访问,提示: PHP Fatal error: Call to undefined function bindtextdomain() in …… 解决办法: 查php.ini文件, extension=php_gettext.dll 去掉前面...

IAR显示行号

IAR显示行号

个人比较习惯用外部编辑器来编辑程序,但是调试工具还是得用IAR,有时候要找到某一行程序,就必须知道行号。 Tools-> Option -> Editor -> Show line numbers(勾选)...

Android Studio: This version of the rendering library is more recent than your version of Android Studio

Android Studio: This version of the rendering library is more recent than your version of Android Studio

Android Studio预览xml布局时,提示: This version of the rendering library is more recent than your version of Android Studio. Please update Android Studio 如图所示...

Windows10 安装软件时提示 the error code is 2503/2502 错误解决办法

Windows10 安装软件时提示 the error code is 2503/2502 错误解决办法

问题内容:Windows10 安装软件时提示“ the error code is 2503/2502”错误代码分析原因:由于安装.msi格式的软件时,无法使用管理员身份运行,导致权限不够,从而引起2503/2502代码的错误解决方法:设置 C:\WINDOWS\TEMP的权限1、依次打开“ 我的电...

vs2010删除臃肿的ipch和sdf文件

vs2010删除臃肿的ipch和sdf文件

VS2010建立C++解决方案时,会生成一个sdf文件和ipch文件夹,这两个文件再加上*.pch等文件使得工程变得非常的庞大,一个简单的程序都会占用几十M的硬盘容量。 解决方法: Tools->Options->Text Editor->C/C++->Advanced(高...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。