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

rotate image offscreen

$
0
0
hi, 

i would like to rotate an image offscreen (as in the background) and save it.
i tried the following:

  1.   size(640, 480);
  2.   PGraphics printerImage;
  3.   PImage img = loadImage("shot0.jpg");
  4.   printerImage = createGraphics(img.width, img.height);
  5.   printerImage.beginDraw();
  6.   printerImage.image(img, 0, 0);
  7.   printerImage.rotate(radians(90));
  8. //  printerImage.updatePixels();
  9.   printerImage.endDraw();
  10.   img = printerImage.get();
  11.   String path = savePath("shots/bpmRotated.jpg");
  12.   printerImage.save(path);
however, the saved image is not rotated. nor are any errors thrown.
any ideas?

thanks for any help!
jns

Viewing all articles
Browse latest Browse all 1768

Trending Articles