&&无法应用于bool和int类型的操作数,何解?
本人用C#做以下程序代码privatevoid邻域清除ToolStripMenuItem_Click(objectsender,EventArgse){Colorc=ne...
本人用C#做以下程序代码 private void 邻域清除ToolStripMenuItem_Click(object sender, EventArgs e) { Color c = new Color(); Bitmap box1 = new Bitmap(pictureBox1.Image); Bitmap box2 = new Bitmap(pictureBox1.Image); int cc,r1,r2,r3,r4; for (int i = 1; i < pictureBox1.Image.Width - 2; i += 1) { for (int j = 1; j < pictureBox1.Image.Height - 2; j += 1) { c = box1.GetPixel(i, j); cc= c.R; c = box1.GetPixel(i + 1, j); r1 = c.R; c = box1.GetPixel(i - 1, j); r2 = c.R; c = box1.GetPixel(i - 1, j + 1); r3 = c.R; c = box1.GetPixel(i - 1, j - 1); r4 = c.R; if((r2==255)&&(r3==255)&&(r4==255)&&(r1=255)) { Color c1 = Color.FromArgb(255,255,255); box2.SetPixel(i, j, c1); } else { Color c2=Color.FromArgb(cc,cc,cc); box2.SetPixel(i,j,c2); } } } pictureBox2.Refresh(); pictureBox2.Image = box2; } } 其中的 if((r2==255)&&(r3==255)&&(r4==255)&&(r1=255))此句提示:&&无法应用于bool和int类型的操作数 请问高手该如何解决!! 不胜感激
展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询