We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsSoftware Bugs › PImage, Rect drawing differently, same vars!
Page Index Toggle Pages: 1
PImage, Rect drawing differently, same vars! (Read 861 times)
PImage, Rect drawing differently, same vars!
Jun 24th, 2006, 7:34pm
 
Hello,
I'm drawing a PImage and a Rect directly to a PGraphics2 object:
    oot.rect(0,0,w,h);  //draw image placeholder
    oot.image(t, 0, 0, w, h);

and I get the following image:
http://www.staronesw.com/temp/Output.jpg

The drawing code is exactly as seen above, and the image size is 1020x1400 (it's not even square!). This bug/problem occurs when I load any image, and it always shows up the same.
Why is this image drawing at the wrong size?

Solved!
My values were 2.5 and 2.5. These got chopped off to 2.0 and 2.0. Somewhere in the processing code it's doing that, even though the scale is way below zero, thus making the image completely wrong when drawn with the int values. I solved it by putting the following code in:
       oot.pushMatrix();
       oot.scale(.01);
       oot.rect(0,0,w*100,h*100);  //draw image placeholder
       oot.image(t, 0, 0, w*100, h*100);
       oot.popMatrix();

Is this a bug?
Re: PImage, Rect drawing differently, same vars!
Reply #1 - Jun 27th, 2006, 2:16am
 
hm, possible.. if you could file a bug report, and include your sketch (attach both the one that works and the one that doesn't to the report) i'll check it out. use tools -> archive sketch to archive each and add them as attachments to the bug.
Page Index Toggle Pages: 1