|
-
August 15th, 1999, 12:40 PM
#1
Resizing canvas in scrollpane
I'm trying to load a different image into a scrollpane whenever the user clicks a button.
The images have different sizes.
How do I get my canvas to resize to the actual size of the image ?
The scrollbars on the scrollpane remains the same, so the larger image gets cropped to the size of the smaller image.
Thanks in advance for responding to this post.
-
August 4th, 2000, 10:28 AM
#2
Re: Resizing canvas in scrollpane
I have a similar problem, i've tried to invalide and then validate the ScrollPane but it doesn't work.
If someone knows the answer it would be of GREAT help !!
-
August 15th, 2000, 07:36 AM
#3
Re: Resizing canvas in scrollpane
I also have the same problem, to me it seems like the first image you load in to the scrollpane sets the size of it. So I have a very big Panel whit some text in it(where I explain how to use this program) as a first image, and after that I can load the smaler canvas.
-
August 15th, 2000, 05:02 PM
#4
Re: Resizing canvas in scrollpane
ummm...have you tried getting the size of the actual image using
int width = image.getWidth(this);
int height = image.getHeight(this);
then using the handle of the canvas together with the command "resize". If you then call "validate" this should resize your canvas!
Casa
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|