| x1 = 0; y1 = 0; w = sWidth; h = sHeight; } //开始绘图 for(x = 1; x < w; x++) { for(y = 1; y < h; y++) { al = alpha; rl = wImage.GetPixel(x,y).R; gl = wImage.GetPixel(x,y).G; bl = wImage.GetPixel(x,y).B; al = 70; if(rl + 25 < 255) rl += 25; if(gl + 25 < 255) gl += 25; if(bl + 25 < 255) bl += 25; g.DrawEllipse(new Pen(new SolidBrush(Color.FromArgb(al,rl,gl,bl))),x1+x,y1+y,1,1); } } g.Save(); sImage.Save(saveFile); result = true; } catch { result = false; } return result; } private void btn_Water_Click(object sender, System.EventArgs e) { using(OpenFileDialog dlg = new OpenFileDialog()) { if(dlg.ShowDialog() == DialogResult.OK) { string file = dlg.FileName; if(File.Exists(file)) { this.WaterFile = file; imgWater.Image = new Bitmap(file); } } dlg.Dispose(); } } } } |