VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Resize Picture to Fit Picturebox

by Kamilche (35 Submissions)
Category: Graphics
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (9 Votes)

A one-liner that resizes a picture to fit the dimensions of a picturebox. No API calls.

Assumes
Picture1 autoredraw should be 'true' Form and picturebox scalemode should be 'vbPixels'

Rate Resize Picture to Fit Picturebox

Picture1.Picture = LoadPicture(FileName)
Picture1.PaintPicture Picture1.Picture, 0, 0, Picture1.Width, Picture1.Height

Download this snippet    Add to My Saved Code

Resize Picture to Fit Picturebox Comments

No comments have been posted about Resize Picture to Fit Picturebox. Why not be the first to post a comment about Resize Picture to Fit Picturebox.

Post your comment

Subject:
Message:
0/1000 characters