Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Image Coordinates and Scaling  RSS feed

 
Vincent Cas
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm creating and saving a BufferedImage with width and height 765. I'm then applying an scale AffineTransform of 3 on each axis.

Then I'm attempting to draw a rectangle with x1, y1, coordiantes of 3, which scales to 9, and x2, y2 coordinates of 252, which scales to 756. However, the rectangle always seems to overlap the bottom right corner of the image and I have no idea why.

Does anyone have any suggestions as to what I might be doing wrong?

Thanks for your time,
 
Vincent Cas
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the code i'm using.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!