Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void putPoint(Point pt, int thickness, Color col) {
- int x = (int)pt.X;
- int y = (int)pt.Y;
- if (thickness % 2 == 0)
- thickness -= 1;
- if (thickness < 1)
- thickness = 1;
- for (int i = 0; i <= thickness / 2; i++) {
- for (int j = (thickness / 2) - i; j >= 0; j--) {
- if (thickness < 4 || (j != (thickness / 2) && i != (thickness / 2))) {
- if (x + i < Operative.PixelWidth && x + i >= 0) {
- if (y + j < Operative.PixelHeight && y + j >= 0)
- Operative.SetPixel(x + i, y + j, col);
- if (j != 0 && y - j < Operative.PixelHeight && y - j >= 0)
- Operative.SetPixel(x + i, y - j, col);
- }
- }
- if (!(thickness > 3 && i == (thickness / 2))) {
- if (i != 0 && x - i < Operative.PixelWidth && x - i >= 0) {
- if (y + j < Operative.PixelHeight && y + j >= 0)
- Operative.SetPixel(x - i, y + j, col);
- if (j != 0 && y - j < Operative.PixelHeight && y - j >= 0)
- Operative.SetPixel(x - i, y - j, col);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement