473,507 Members | 5,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

To all you intelligent Java people...

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. 7
rows)
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.createWrita bleChild(IntegerInterleave
dRaster.java:453)
at java.awt.image.BufferedImage.getSubimage(BufferedI mage.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.
Jul 17 '05 #1
0 1300

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1278
by: Graham Norman | last post by:
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...
73
7902
by: RobertMaas | last post by:
After many years of using LISP, I'm taking a class in Java and finding the two roughly comparable in some ways and very different in other ways. Each has a decent size library of useful utilities...
16
3903
by: Thomas G. Marshall | last post by:
This message is sent to these newsgroups because they are no longer valid: comp.lang.java comp.lang.java.api comp.lang.java.bugs comp.lang.java.misc comp.lang.java.setup comp.lang.java.tech
0
2141
by: Conference Secretary | last post by:
CALL FOR PAPERS International Conference on Intelligent Agents, Web Technologies and Internet Commerce http://www.ise.canberra.edu.au/conferences/iawtic05/ Jointly with International...
8
11195
by: Michael A. Covington | last post by:
Has anyone made any tests they'd like to tell me about? -- Michael A. Covington - Artificial Intelligence Ctr - University of Georgia "In the core C# language it is simply not possible to...
1
9585
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
2
2242
tpgames
by: tpgames | last post by:
I have a question: does anyone know of a Java Script (not java) chess game in which the IA is actually intelligent? The one on my site is not intelligent, as I almost beat the computer. I play...
0
1547
by: JTP PR | last post by:
Global business intelligence vendor Yellowfin is investing in the best available Java technologies and people to stay at the forefront of web- based BI software development. Since 2003, the...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.