Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup()
- {
- size(800, 600);
- }
- void flaga(int x, int y, int szer, int wys)
- {
- for (int i=x; i <szer; i++)
- {
- for (int j = y; j < wys/3; j++)
- {
- color c = color(0, 0, 0);
- set(i, j, c);
- }
- }
- for (int i=x; i <szer; i++)
- {
- for (int j= wys/3; j < 2*wys/3-y; j++)
- {
- color c = color(255, 0, 0);
- set(i, j, c);
- }
- }
- for (int i=x; i <szer; i++)
- {
- for (int j= 2*wys/3-y; j < wys-2*y; j++)
- {
- color c = color(255, 255, 0);
- set(i, j, c);
- }
- }
- }
- void putPixel(int x, int y, int r, int g, int b)
- {
- r &=255;
- g &=255;
- b &=255;
- int a =y + width * x;
- int k=255000000 | (r<<16) | (g<<8) | (b) ;
- pixels[a] = k;
- }
- void draw()
- {
- //flaga (10, 50, 500, 400);
- loadPixels();
- putPixel(10, 10, 255, 0, 0);
- }
Add Comment
Please, Sign In to add comment