int ex=0; int ey=0; void setup() { background(255); size(1024, 850); stroke(0); fill(255); rect(0, 0, 1200, 30); fill(0); textSize(30); text("Datei", 0, 25); fill(0); textSize(30); text("Frame", 90, 25); fill(0); textSize(30); text("Pixel", 300, 25); fill(0); textSize(30); text("ClearFrame", 400, 25); fill(0); textSize(30); text("Size: +/-", 650, 25); fill(0); textSize(30); text("Folder: 0", 820, 25); noStroke(); fill(255); rect(599, 599, 301, 201); stroke(0); fill(255); rect(599, 29, 201, 201); fill(255); rect(599, 229, 201, 201); fill(255); rect(799, 229, 201, 201); fill(255); rect(799, 29, 201, 201); fill(255); rect(599, 629, 201, 201); fill(255); rect(799, 429, 201, 201); fill(255); rect(599, 429, 201, 201); fill(0); textSize(30); text("Rechts", 850, 525); fill(0); textSize(30); text("Links", 650, 525); } color cr=color(0, 0, 0); float mouseovery=0; float mouseoverx=0; color seeCountC=0; color seeN=0; color seeC=0; int x=2; int y=0; int cx=0; int cy=0; int x2=0; int y2=0; int seeCountNum=0; int drawnum=0; color seeX=0; color tag=color(0); int z=0; int eof=0; int eol=0; int vox=0; int voy=0; int feld=1; int num=30; int sum=0; int sumg=0; int sumlx=0; int sumly=0; int sumlxg=0; int sumlyg=0; int getx=0; int gety=0; int dom=0; int pop=0; color point=color(0); int rc=0; int gc=0; int bc=0; int rcb=0; int gcb=0; int bcb=0; int scb=0; int num1=30; int iv=1; int sc=0; int qc=0; PImage bild; PImage bildr; PImage bildg; PImage bildb; PImage bildbw; int ordner=0; int ml=1; int mr=0; int mcx=0; int mcy=0; int getty=0; void draw() { mcy = mouseY; mcx = mouseX; noStroke(); if (scb<=254) { scb++; fill(scb); rect(scb, 800, 255-scb, 25); sc=128; } if (rcb<=254) { rcb++; fill(rcb, 0, 0); rect(rcb, 680, 255-rcb, 25); } if (gcb<=254) { gcb++; fill(0, gcb, 0); rect(gcb, 710, 255-gcb, 25); } if (bcb<=254) { bcb++; fill(0, 0, bcb); rect(bcb, 740, 255-bcb, 25); } if (scb<=254) { fill(rcb, gcb, bcb); rect(scb, 770, 255-scb, 25); } mouseovery = mouseY; mouseoverx = mouseX; if ((mcx>=599&&mcx<=799)&&(mcy>=429&&mcy<=629)) { stroke(0); fill(255); rect(799, 429, 201, 201); fill(0); rect(599, 429, 201, 201); fill(0); textSize(30); text("Rechts", 850, 525); fill(255); textSize(30); text("Links", 650, 525); ml=1; mr=0; mcy = 0; mcx = 0; }else if ((mcx>=799&&mcx<=999)&&(mcy>=429&&mcy<=629)) { stroke(0); fill(0); rect(799, 429, 201, 201); fill(255); rect(599, 429, 201, 201); fill(255); textSize(30); text("Rechts", 850, 525); fill(0); textSize(30); text("Links", 650, 525); ml=0; mr=1; mcy = 0; mcx = 0; } if ((mcx>=730&&mcx<=780)&&(mcy>=0&&mcy<=30)) { if (ml==1) { num++; dom=1; sumlx=0; if (num>100)num=100; sumly=0; num1=num; mcy = 0; mcx = 0; } if (mr==1) { num--; dom=1; sumlx=0; if (num<2)num=1; sumly=0; num1=num; mcy = 0; mcx = 0; } } if (dom==1||getty==0) { dom=0; fill(200); rect(0, 30, 600, 600); feld=600/(num+1); getty=1; while (sumly=0&&cx<=feld*(num1+1)-1)&&(mcy>=30&&mcy<=feld*(num1+1)+30-1)) { if (mr==1) { gety= (int)mouseovery; getx=(int)mouseoverx ; sumlx=floor(getx/feld); sumly=floor(gety/feld); println("x"+sumlx); println("y"+sumly); point = get((int)mouseoverx, (int)mouseovery); pop=1; cr = color(point); float redValue = red(cr); // Get red in 'c' float blueValue = blue(cr); // Get red in 'c' float greenValue = green(cr); // Get red in 'c' rc=(int)redValue; gc=(int)greenValue; bc=(int)blueValue; fill(rc, gc, bc); rect(0, 770, 255, 25); fill(200); rect(260, 680, 70, 30); fill(255); rect(0, 676, 255, 4); noStroke(); fill(0); rect(rc, 676, 1, 4); noStroke(); fill(0); textSize(25); text(rc, 260, 700); fill(200); rect(260, 710, 70, 30); fill(255); rect(0, 706, 255, 4); noStroke(); fill(0); rect(gc, 706, 1, 4); noStroke(); fill(0); textSize(25); text(gc, 260, 730); fill(200); rect(260, 740, 70, 30); fill(255); rect(0, 736, 255, 4); noStroke(); fill(0); rect(bc, 736, 1, 4); noStroke(); fill(0); textSize(25); text(bc, 260, 760); mcy = 0; mcx = 0; } if (ml==1) { gety= (int)mouseovery-30; getx=(int)mouseoverx ; sumlx=floor(getx/feld); sumly=floor(gety/feld); // println("x"+sumlx); // println("y"+sumly); // point = get(sumlx*feld+1,sumly*feld+1); pop=1; fill(rc, gc, bc); rect(sumlx*feld, sumly*feld+30, feld, feld); fill(rc, gc, bc); rect(sumlx+601, sumly+631, 1, 1); fill(rc, 0, 0); rect(sumlx+601, sumly+31, 1, 1); fill(0, gc, 0); rect(sumlx+801, sumly+31, 1, 1); fill(0, 0, bc); rect(sumlx+601, sumly+231, 1, 1); qc=(rc+gc+bc)/3; fill(qc); rect(sumlx+801, sumly+231, 1, 1); mcy = 0; mcx = 0; } } if ((mcx>=0&&mcx<=255)&&(mcy>=680&&mcy<=710)) { if (ml==1||mr==1) { rc=(int)mouseoverx ; fill(rc, gc, bc); rect(0, 770, 255, 25); fill(200); rect(260, 680, 70, 30); fill(255); rect(0, 676, 255, 4); noStroke(); fill(0); rect(rc, 676, 1, 4); noStroke(); fill(0); textSize(25); text(rc, 260, 700); mcy = 0; mcx = 0; } } if ((mcx>=0&&mcx<=255)&&(mcy>=710&&mcy<=740)) { if (ml==1||mr==1) { gc=(int)mouseoverx ; fill(rc, gc, bc); rect(0, 770, 255, 25); fill(200); rect(260, 710, 70, 30); fill(255); rect(0, 706, 255, 4); noStroke(); fill(0); rect(gc, 706, 1, 4); noStroke(); fill(0); textSize(25); text(gc, 260, 730); mcy = 0; mcx = 0; } } if ((mcx>=0&&mcx<=255)&&(mcy>=740&&mcy<=800)) { if (ml==1||mr==1) { bc=(int)mouseoverx ; fill(rc, gc, bc); rect(0, 770, 255, 25); fill(200); rect(260, 740, 70, 30); fill(255); rect(0, 736, 255, 4); noStroke(); fill(0); rect(bc, 736, 1, 4); noStroke(); fill(0); textSize(25); text(bc, 260, 760); mcy = 0; mcx = 0; } } if ((mcx>=260&&mcx<=300)&&(mcy>=680&&mcy<=710)) { if (ml==1) { rc++;if(rc>255)rc=255; mcy = 0; mcx = 0; } if (mr==1) { rc--;if(rc<0)rc=0; mcy = 0; mcx = 0; } fill(rc, gc, bc); rect(0, 770, 255, 25); fill(200); rect(260, 680, 70, 30); fill(255); rect(0, 676, 255, 4); noStroke(); fill(0); rect(rc, 676, 1, 4); noStroke(); fill(0); textSize(25); text(rc, 260, 700); } if ((mcx>=260&&mcx<=300)&&(mcy>=710&&mcy<=740)) { if (ml==1) { gc++;if(gc>255)gc=255; mcy = 0; mcx = 0; } if (mr==1) { gc--;if(gc<0)gc=0; mcy = 0; mcx = 0; } fill(rc, gc, bc); rect(0, 770, 255, 25); fill(200); rect(260, 710, 70, 30); fill(255); rect(0, 706, 255, 4); noStroke(); fill(0); rect(gc, 706, 1, 4); noStroke(); fill(0); textSize(25); text(gc, 260, 730); } if ((mcx>=260&&mcx<=300)&&(mcy>=740&&mcy<=770)) { if (ml==1) { bc++;if(bc>255)bc=255; mcy = 0; mcx = 0; } if (mr==1) { bc--;if(bc<0)bc=0; mcy = 0; mcx = 0; } fill(rc, gc, bc); rect(0, 770, 255, 25); fill(200); rect(260, 740, 70, 30); fill(255); rect(0, 736, 255, 4); noStroke(); fill(0); rect(bc, 736, 1, 4); noStroke(); fill(0); textSize(25); text(bc, 260, 760); } mcy = mouseY; mcx = mouseX; if ((mcx>=260&&mcx<=300)&&(mcy>=800&&mcy<=830)) { if (ml==1) { rc++; gc++; bc++; if (rc>255)rc=255; if (gc>255)gc=255; if (bc>255)bc=255; mcy = 0; mcx = 0; } if (mr==1) { rc--; gc--; bc--; if (rc<1)rc=0; if (gc<1)gc=0; if (bc<1)bc=0; mcy = 0; mcx = 0; } fill(rc, gc, bc); rect(0, 770, 255, 25); fill(200); rect(260, 740, 70, 30); fill(255); rect(0, 736, 255, 4); noStroke(); fill(0); rect(bc, 736, 1, 4); noStroke(); fill(0); textSize(25); text(bc, 260, 760); fill(200); rect(260, 710, 70, 30); fill(255); rect(0, 706, 255, 4); noStroke(); fill(0); rect(gc, 706, 1, 4); noStroke(); fill(0); textSize(25); text(gc, 260, 730); fill(200); rect(260, 680, 70, 30); fill(255); rect(0, 676, 255, 4); noStroke(); fill(0); rect(rc, 676, 1, 4); noStroke(); fill(0); textSize(25); text(rc, 260, 700); fill(0); textSize(25); text(sc, 260, 790); } fill(200); rect(260, 770, 200, 30); fill(0); textSize(25); text(+rc+" "+gc+" "+bc+" ", 260, 790); sc=floor((rc+gc+bc)/3); fill(sc); rect(0, 800, 255, 25); fill(200); rect(260, 800, 70, 30); fill(0); textSize(25); text(sc, 260, 820); if (( mcx>=400&&mcx<=570)&&(mcy>=0&&mcy<=30)) { stroke(0); if (ml==1) { noStroke(); fill(255); rect(0, 30, feld*(num1+1)+1, feld*(num1+1)+1); fill(255); rect(600, 30, num1+1+1, num1+1+1); fill(255); rect(800, 30, num1+1+1, num1+1+1); fill(255); rect(600, 230, num1+1+1, num1+1+1); fill(255); rect(800, 230, num1+1+1, num1+1+1); fill(255); rect(600, 630, num1+1+1, num1+1+1); mcy = 0; mcx = 0; } if (mr==1) { noStroke(); fill(rc, gc, bc); rect(0, 30, feld*(num1+1)+1, feld*(num1+1)+1); fill(rc, 0, 0); rect(600, 30, num1+1+1, num1+1+1); fill(0, gc, 0); rect(800, 30, num1+1+1, num1+1+1); fill(0, 0, bc); rect(600, 230, num1+1+1, num1+1+1); qc=(rc+gc+bc)/3; fill(qc); rect(800, 230, num1+1+1, num1+1+1); fill(rc, gc, bc); rect(600, 630, num1+1+1, num1+1+1); } } }