Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Saving in high resolution URGENT help!

$
0
0
Hello, fellow forum mates, I'm not sure if i'm doing this the right way..  please help. 

I managed to save the file but it's in really low (pixelated) tiff file.

I need to save it in high resolution tiff or pdf file for print! 


Here's the code:

import processing.pdf.*;
import geomerative.*;

RFont myFont;
RGroup myGroup;
RPoint[] myPoints;
String myText = "A";
float angle;

FontAgent[] myAgents;
int step = 7;

PGraphics big;



void setup() {



  size(600, 300);
  background(255);
  smooth();

  big = createGraphics ( 3000, 3000, JAVA2D );

  RG.init(this);
 myFont = new RFont("FreeSans.ttf", 150, CENTER);

  RCommand.setSegmentLength(7);
  RCommand.setSegmentator(RCommand.UNIFORMLENGTH);
  myGroup = myFont.toGroup(myText);
  myPoints = myGroup.getPoints();

  myAgents = new FontAgent[myPoints.length];
  for (int i=0; i<myPoints.length; i++) {
    myAgents[i] = new FontAgent(new PVector(myPoints[i].x, myPoints[i].y));
  }
}


void draw() {


  translate(290, 200);
  big.background(0);
  for (int i = 0; i < myPoints.length; i++) {
    myAgents[i].display();
    strokeWeight(1);
  }

}

class FontAgent {

  PVector loc;

  FontAgent(PVector l) {
    loc = l.get();
  }

  void display() {
    
    
    big.stroke(0);
    float fix = 30;
    //float len = map(mouseY,0,height,0,100);
    float len = map (fix, 0, height, 0, 100);
    pushMatrix();
    translate(loc.x, loc.y);
    big.rotate(map(mouseY, 100, width, 0, TWO_PI));
    //rotate(map(mouseY, 0, width, 0, TWO_PI));

    big.line(-len, -len, len, len);
    popMatrix();

   big.endDraw ();
    big.save ( "type-######.tiff");


      
    }
  }
  


  



Viewing all articles
Browse latest Browse all 1768

Trending Articles