在winfrom中,怎样让病虫防治周边的白边去掉为透明,成为一圆形的图片按钮啊? (我在photoshop中是四周的白边处理为透明的啊,用picturebox导入的病虫防治这图)
这里有具体的截图:http://space.cnblogs.com/question/11565/
这里有具体的截图:http://space.cnblogs.com/question/11565/
解决方案 »
- 关于web表单自动填写问题
- OracleConnection 链接oracle怎么连接不上服务器。。求助
- IList上做级联删除的问题
- 如何实现从键盘输入控制功能
- 安装c#IDE的时候出错,朋友们来看看。
- 用HttpWebRequest登陆这个网站https://esales.tiancity.com/frmLogin.aspx
- 腾迅七周年,送6位QQ免费号
- Winform中对dataGrid中行记录的双击问题...
- 如何取得毫秒啊?
- winform下用Webclient上传文件,默认大小不能超过1M,该如何解决?
- 如何从数据库中的某个表 得到最大的id 赋与页面的文本框?
- 关于分页的。。。急。。。
public void MakeShapeToRound(Control c){
GraphicsPath gp=new GraphicsPath();
gp.AddEllipse(new Rectangle(0,0,c.Size.Width-5,c.Size.Height-5));
c.Region=new Region(gp);
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Bitmap bmp = new Bitmap(@"f:\picture\temp.jpg");
getRegion(bmp);
this.BackgroundImage = bmp;
}
private static Region getRegion(Bitmap bmp)
{
GraphicsPath path = new GraphicsPath();
Color first = bmp.GetPixel(0, 0);
for (int i = 0; i < bmp.Height; i++)
{
for (int j = 0; j < bmp.Width; j++)
{
Color second=bmp.GetPixel(j,i);
if (second != first)
{
path.AddRectangle(new Rectangle(i,j,1,1));
}
}
}
Region g = new Region(path);
return g;
}