[5495] in java-interest
problem with drawImage
daemon@ATHENA.MIT.EDU (tmb@best.com)
Tue Feb 13 22:59:02 1996
From: tmb@best.com
Date: Tue, 13 Feb 1996 05:34:37 -0800
To: java-interest@java.sun.com
In article <pb8vilfkx0e.fsf@best.com> tmb@best.com--Internet writes:
| I'm having problems with the version of drawImage that is supposed to
| rescale/resample an image before a copy operation. If I don't
| rescale, everything works fine:
|
| g.drawImage(image,0,0,c.dp);
|
| But if I add the new width and height parameters (smaller than
| the source image in this case), I just get a white rectangle:
|
| g.drawImage(image,0,0,nw,nh,c.dp);
|
| I couldn't find any documentation on whether I had to do anything else
| for the rescale/resample to work. I tried a call to prepareImage(),
| but that didn't help either.
|
| Is drawImage with rescaling known to work? I have tried this under
| JDK-beta2 (Linux, Windows95) and JDK-1.0 (Windows95), and it behaves
| the same way in both cases.
To partially answer my own question: I wrote a simple applet using
image rescaling and it works in that case (btw, in all cases, I wait
for the operation to complete, so that is not the problem). However,
there is pretty clearly something wrong. First of all, the rescaling
version fails in this context if "image" is a "FileImageSource". It
works if "image" is something created with
"Component.createImage(int,int)", but in that case "drawImage" fails
to return "true" and also fails to notify the "ImageObserver" of
completion later. At the very least, whatever the implementation may
be doing is highly unobvious and not well documented.
Thomas.
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com