首页 新闻 会员 周边 捐助

GDI+读取一张圆的图片,结果出现很多圆,怎么样才能只出现一个圆?

0
悬赏园豆:10 [已关闭问题] 关闭于 2016-04-14 14:56

界面设计:有一个Button,一个pictureBox

代码如下:

try
{
// Retrieve the image.
image1 = new Bitmap(@"C:/Users/Administrator/Desktop/black.png", true);

int x, y;

// Loop through the images pixels to reset color.
for (x = 0; x < image1.Width; x++)
{
for (y = 0; y < image1.Height; y++)
{
Color pixelColor = image1.GetPixel(x, y);
Color newColor = Color.FromArgb(pixelColor.B, 0, 0);
image1.SetPixel(x, y, newColor);
}
}

// Set the PictureBox to display the image.
pictureBox1.Image = image1;


}
catch (ArgumentException)
{
MessageBox.Show("There was an error." +
"Check the path to the image file.");
}

随风起舞的主页 随风起舞 | 初学一级 | 园豆:19
提问于:2016-04-14 14:46
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册