I want to stretch an image in picturebox. Is there any property to do it? In VB.NET there is is a property called "size mode". we can change that property to "stretch image". still i couldn't find VB6 property to do it. Please tell me the property or if there is not a property, how to do it?

Recommended Answers

All 2 Replies

Try This :

Private Sub Streching()
    Picture1.ScaleMode = 3
    Picture1.AutoRedraw = True
    Picture1.PaintPicture Picture1.Picture, _
        0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, _
        0, 0, _
        Picture1.Picture.Width / 26.46, _
        Picture1.Picture.Height / 26.46
    Picture1.Picture = Picture1.Image
End Sub

Private Sub Form_Load()
Streching
End Sub
commented: To true.. +3

Oh! thanks a lot Jx Man. It works.....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.