Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Bitmap jpg = (Bitmap)pictureBox2.Image, jpg1 = new Bitmap(jpg.Width, jpg.Height);
  2. int x, y, r, g, b; Color cl; double rs, gs, bs;
  3. int r_shift = 0, g_shift = 10, b_shift = -10;
  4. for (y = 0; y < jpg.Height; y++)
  5. {
  6. for (x = 0; x < jpg.Width; x++)
  7. {
  8. if (x < jpg.Width + r_shift && x > r_shift ) r = jpg.getPixel(x-r_shift,y).R;
  9. if (x < jpg.Width + g_shift && x > g_shift ) r = jpg.getPixel(x-g_shift,y).G;
  10. if (x < jpg.Width + b_shift && x > b_shift ) r = jpg.getPixel(x-b_shift,y).B;
  11. cl = Color.FromArgb(r, g, b);
  12. jpg1.SetPixel(x, y, cl);
  13. }
  14. Application.DoEvents();
  15. }
  16. pictureBox3.Image = jpg1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement