P
Peter the Swede
Best groupmember,
I have a class SurfaceGrid that extends BufferedImage. I use the properties
of BufferedImage to save the class SurfaceGrid. The only thing that differs
SurfaceGrid from BufferedImage is that I have som constant int's that I use
for classification of objects in my surface.
The writing to file is no problem, it is the reading that gives me problem.
I read the file like this:
BufferedImage tempImg = ImageIO.read(new File(mySurfaceGridFileName);
After that I want to cast tempImg to SurfaceGrid, but by trying:
SurfaceGrid sg = (SurfaceGrid) tempImg;
That does not work, what should I do?
I would appreciate any suggestions.
Cheers, Peter
I have a class SurfaceGrid that extends BufferedImage. I use the properties
of BufferedImage to save the class SurfaceGrid. The only thing that differs
SurfaceGrid from BufferedImage is that I have som constant int's that I use
for classification of objects in my surface.
The writing to file is no problem, it is the reading that gives me problem.
I read the file like this:
BufferedImage tempImg = ImageIO.read(new File(mySurfaceGridFileName);
After that I want to cast tempImg to SurfaceGrid, but by trying:
SurfaceGrid sg = (SurfaceGrid) tempImg;
That does not work, what should I do?
I would appreciate any suggestions.
Cheers, Peter