Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. public void putPoint(Point pt, int thickness, Color col) {
  2. int x = (int)pt.X;
  3. int y = (int)pt.Y;
  4. if (thickness % 2 == 0)
  5. thickness -= 1;
  6. if (thickness < 1)
  7. thickness = 1;
  8.  
  9. for (int i = 0; i <= thickness / 2; i++) {
  10. for (int j = (thickness / 2) - i; j >= 0; j--) {
  11. if (thickness < 4 || (j != (thickness / 2) && i != (thickness / 2))) {
  12. if (x + i < Operative.PixelWidth && x + i >= 0) {
  13. if (y + j < Operative.PixelHeight && y + j >= 0)
  14. Operative.SetPixel(x + i, y + j, col);
  15. if (j != 0 && y - j < Operative.PixelHeight && y - j >= 0)
  16. Operative.SetPixel(x + i, y - j, col);
  17. }
  18. }
  19. if (!(thickness > 3 && i == (thickness / 2))) {
  20. if (i != 0 && x - i < Operative.PixelWidth && x - i >= 0) {
  21. if (y + j < Operative.PixelHeight && y + j >= 0)
  22. Operative.SetPixel(x - i, y + j, col);
  23. if (j != 0 && y - j < Operative.PixelHeight && y - j >= 0)
  24. Operative.SetPixel(x - i, y - j, col);
  25. }
  26. }
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement