Results 1 to 2 of 2

Thread: picture ctrl- stretch property- save as a bitmap

  1. #1
    Guest

    Post

    The pictureBox control is supposed to be better than the image control but I actually need the stretch property of the image ctrl.
    How can I do to have the content of a picture ctrl (bitmap) to fit the picture control dimensions?

    If not possible, how can I save as a bitmap the content of an image ctrl as I see it

    e.g : image ctrl stretch prop set to true and width is X after loading a bitmap

    if I make X = 2X , i've got a new display; how can i save the "new" image/display on disk as a bimap of width = 2X ?


    thank you for any info


  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Add a Picturebox and a Command Button to a Form, Load a Picture into the Picturebox, make the Picturebox the Size you want the Image to be..
    Code:
    Private Sub Command1_Click()
        With Picture1
            .AutoRedraw = True
            .PaintPicture .Picture, 0, 0, .ScaleWidth, .ScaleHeight, 0, 0, ScaleX(.Picture.Width, vbHimetric, vbTwips), ScaleY(.Picture.Height, vbHimetric, vbTwips)
            .Picture = .Image
        End With
        SavePicture Picture1.Picture, "C:\Large.bmp"
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

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