Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Education > Homework, comp. sci. > To all you inte...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 3 of 33
Post > Topic >>

To all you intelligent Java people... (read this one, other had wrong email)

by "Graham Norman" <gcn1@[EMAIL PROTECTED] > Nov 6, 2003 at 08:55 PM

I am trying to create a sub image of a bufferedimage which contains a
picture.
I've divided the whole picture up into 80 by 80 pixels which gives me 7
rows
and 6 columns. (there's a bit of wasted picture which I don't care about)

Therefore each y coordinate runs from 0 to 480 in 80 increments (e.g.
7rows)
The height of the area must be no less than 480+80 which is 560.
When I return the height it tells me that:
currentImage.getData().getHeight() is: 494

And thus this error is returned:

java.awt.image.RasterFormatException: (y + height) is outside raster at

sun.awt.image.IntegerInterleavedRaster.createWritableChild(IntegerInterleave
dRaster.java:453) at

java.awt.image.BufferedImage.getSubimage(BufferedImage.java:1060)

To calculate the number of columns I did integer division imageHeight/80
which gives 6.
If you double division it gives 6.175, therefore there should be 0.175
rows
of which I won't be using.

So my question is: Why does my last row go over the boundry of the
origional
image?

Any help appreciated,
Gray.
 




 1 Posts in Topic:
To all you intelligent Java people... (read this one, other had
"Graham Norman"  2003-11-06 20:55:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 13:56:55 CDT 2008.