954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to stretch an image in picturebox?

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?

Prasad.weer
Junior Poster in Training
52 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

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
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

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

Prasad.weer
Junior Poster in Training
52 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You