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

Threaded View

  1. #1
    Join Date
    May 1999
    Location
    G day Mayt Land
    Posts
    971

    [RESOLVED] avoid stretching an image but in a fixed size

    I am displaying an Image in a fixed size section of screen say X and Y
    If the picture happend to be smaller or bigger I use stretch to fit it in my area of control.
    Now the area could be wider or taller and .tretch woudl make it look unproportinal.

    Without any mathematical calculation that I m trying to avoid,
    is there any way that VB6 could resize that image keeping the same aspect ration and only use the area X & Y.
    of course that may mean i ll endup with some extra space unused at the bottom or on the right which is undeatndable.

    But can this be done via image property and VB6 ?
    a sample of the code:
    Code:
        Image1(j).Visible = True
                    Image1(j).Width = getValue(str0, "Width")
                    Image1(j).Height = getValue(str0, "Height")
                    Image1(j).Stretch = True
    
                    Image1(j).Top = Label6(j).Top + Label6(j).Height
                    Image1(j).Left = Label6(j).Left
    Last edited by Saeed; July 4th, 2010 at 10:32 PM.

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