E
Elliot
Hi All,
I need to rescale and print some jpeg and bmp files in Java
application. My code is inside of a class "GraphicPages" that
implements Printable.
The actual rescale logic is contained in the print() method and uses
the following line to locate and initialize the Image itself
Image imgSource ;
this.imgSource =
Toolkit.getDefaultToolkit().getImage(shp.getPath());
To implement the rescale logic I need to use imgSource.getWidth and
Height. If I use my printable class as the observer
"imgSource.getWidth(this)" I get an error saying:
"getWidth(java.awt.image.ImageObserver) in java.awt.Image cannot be
applied to (GraphicPages)
The only way I can get this to compile is to use "null" instead of
"this" for the ImageObserver parameter.
If I use "null" will this work?
Thanks
Elliot
I need to rescale and print some jpeg and bmp files in Java
application. My code is inside of a class "GraphicPages" that
implements Printable.
The actual rescale logic is contained in the print() method and uses
the following line to locate and initialize the Image itself
Image imgSource ;
this.imgSource =
Toolkit.getDefaultToolkit().getImage(shp.getPath());
To implement the rescale logic I need to use imgSource.getWidth and
Height. If I use my printable class as the observer
"imgSource.getWidth(this)" I get an error saying:
"getWidth(java.awt.image.ImageObserver) in java.awt.Image cannot be
applied to (GraphicPages)
The only way I can get this to compile is to use "null" instead of
"this" for the ImageObserver parameter.
If I use "null" will this work?
Thanks
Elliot