Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27376

Help Newbie on Loading Picture

$
0
0
Hi Guys

First post here Im sure this is something simple but I cant get it to work

I have a Picturebox on my form with a blank picture in it

I have a button which when clicked opens the opendialog picture box so I can select a jpg file it then loads into the picturebox a picture using the following code

PictureBox5.Image = Image.FromFile(openFileDialog1.FileName)

This all works fine except i cant see all the picture as it needs fitting to the size of the picturebox

I tried the following code to no avail

PictureBox5.BackgroundImageLayout = ImageLayout.Stretch

any ideas where i have gone wrong? is there another way to achieve what I am trying to do?

Thanks

Mark

Viewing all articles
Browse latest Browse all 27376

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>