aucotsi
YaBB Newbies
Offline
Posts: 3
how i can save in an image format?
Jul 29th , 2009, 8:01am
save("name.tif"); is non working in this code, any suggestions? ////////////////////////// import net.nexttext.*; import net.nexttext.behaviour.*; import net.nexttext.behaviour.control.*; import net.nexttext.behaviour.dform.*; import net.nexttext.behaviour.physics.*; import net.nexttext.behaviour.standard.*; Book book; PFont font; void setup() { size(1200, 1500); background(42); smooth(); make(width/2, height/2, 6, 1425, 1360, color(253,10,10), 45, color(15,155,255), SQUARE, ROUND); make(width/2, height/2, 12, 137, 203, color(3,210,10), 45, color(15,0,0, 93), SQUARE, MITER); book = new Book(this); // load and set the font font = createFont("GeometricBlack.ttf", 288); textFont(font); textAlign(CENTER); fill(255); stroke(96); strokeWeight(15); // build the text book.addText("biri biri", width/2, height/2); } void draw() { book.stepAndDraw(); } void make(float x, float y, float s, float rad1, float rad2, color c1, float init, color c2, int endCap, int endJoin) { float px=0; float py=0; float angle = init; float ang=(360/s)/2.0; float ang2=(360/s)/4.0; strokeWeight(s*5); stroke(c2); strokeCap(endCap); strokeJoin(endJoin); fill(c1); beginShape(); for(int i=0;i<s; i++){ px=x+cos(radians(angle))*rad1; py=y+sin(radians(angle))*rad1; vertex(px,py); angle+=ang; px=x+cos(radians(angle))*rad1; //nice x/cos... py=y+sin(radians(angle))*rad1; vertex(px,py); angle+=ang2; px=x+cos(radians(angle))*rad2; py=y+sin(radians(angle))*rad2; vertex(px,py); px = x; py = y; vertex(px,py); /* float foo = px; px = py; py = foo; vertex(px,py); */ angle+=ang2; } endShape(CLOSE); } //save("biri.tif");