Hello Terry,
I did nearly the same as you but in opposite sequence. I mean I have first
created the Jpanel, with its width and height, and then I instantiated a
BufferedImage with these dimensions, and my image is not cut.
I hope this helps.
Florence
-----Original Message-----
From: Terry Wu [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 12, 2001 2:36 AM
To: [EMAIL PROTECTED]
Subject: [JAVA2D] Matching Frame Size with Image Size?
Hi,
I am having the following problem:
I'd like to open an image, draw it on a JPanel and then
display it in a JFrame. I can get the image size by using
the getWidth() and getHeight() methods of the BufferedImage.
But I am having trouble to match the dimensions of JPanel
or JFrame with that of an image. If I use the image width
and height to setSize for JPanel or JFrame, a small portion
of the image is always cut of in the JFrame at the bottom.
I believe this is caused by the height of the title bar of
JFrame makes the display area a bit smaller. I looked around
and cannot find a solution. Can someone please suggest a
get-around?
Thanks in advance,
Terry
__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".