Results 1 to 3 of 3

Thread: [RESOLVED] Stretch an image

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2011
    Posts
    81

    Resolved [RESOLVED] Stretch an image

    Hi

    I´m using an image box to reduce the size of some pictures. I have the stretch set to true. I then want to copy them to a picture box and the rotate them 90.

    My problem is that when I copy them int the pictre box like this:

    Picture1.Picture = Image1.Picture

    The return to their original size.

    Any help?

    Keli

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Stretch an image

    You'll need to render the image to the picturebox in stretched size
    Code:
    ' resize Picture1 as needed
    Picture1.AutoRedraw = True
    Picture1.Cls
    Picture1.PaintPicture Image1.Picture, 0, 0, _
         ScaleX(Image1.Width, Image1.Container.ScaleMode, Picture1.ScaleMode), _
         ScaleY(Image1.Height, Image1.Container.ScaleMode, Picture1.ScaleMode)
    Set Picture1.Picture = Picture1.Image
    If Image1 is in a frame, change Image1.Container.ScaleMode to vbTwips
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2011
    Posts
    81

    Re: [RESOLVED] Stretch an image

    Thanks a lot for your kind help!

    keli

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