Visual C# : How To Use PictureBox Control in Windows form Application

in #csharp5 years ago

Learn How To Use PictureBox Control in Windows form Application using Visual Studio.

If you like this video then Do share the video in the article to your friends or in your social media accounts. You can also subscribe to the YouTube channel.

I recommend checking out C# in Nutshell Definitive Reference book. You can get a lot of answers to your questions. Plus the new edition of the book can cover some of the latest topics too.

Check out the below video to learn How To Use PictureBox Control in Windows form Application using Visual Studio Professional IDE.

How To Use PictureBox Control in Windows form Application in Visual Studio?

There are times when you want to display the images in your Windows Forms. And you wish to get the pictures requested through specific way in the forms. So the picturebox control is the way to get that sorted in the application.

So let's start by creating the instance of the picturebox in the windows form.

PictureBox imageControl = newPictureBox();

Here imagecontrol is the object that would be manipulating the further image properties which you can edit in the control properties options.

So let's say you wish to modify the width and height of that picture control. You can edit it with code something like this.

imageControl.Width = 300
imageControl.Height = 200

You can also call for the external image source. Say some image is in your hard disk. Say on D: drive in some image folder you have this image. And you wish to call for that image source. So the code would be something like this.

Bitmap image = newBitmap("D:\\Images\\devnami.jpg");

You can see this way you can call for the images in that folder. There are lot of many things you can do and get things executed based on the properties you wish to edit.

If you are interested in learning more, check out Visual C# Winforms Tutorials.

I hope the information here helps you. I'd appreciate if you like the video and share it with others.

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64222.08
ETH 3135.29
USDT 1.00
SBD 3.99