CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Guest

    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.


  2. #2
    Join Date
    Aug 2000
    Location
    France
    Posts
    3

    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 !!



  3. #3
    Join Date
    Aug 2000
    Location
    Norway
    Posts
    6

    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.


  4. #4
    Join Date
    Aug 2000
    Location
    England
    Posts
    19

    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
  •  





Click Here to Expand Forum to Full Width

Featured