![]() Next, we add the OpenFileDialog control on the form. This method enables the user to browse for the image files in the local drives then select a particular image and display it on the picture box at runtime.įirst, we add a button and change its text to View and its name to BtnView. ![]() In this section, we shall learn how to write code to load an image using the Open File Dialog Control. ![]() Running the program will display the same image in the picture box as in Figure 7.4 7.2 Loading an Image in a Picture Box using Open File Dialog Control * You need to search for an image in your local drive and determine its path before you write the code. PictureBox1.Image = Image.FromFile(“C:\Users\Toshiba\Pictures\sporetrip2014\fish.jpg”) Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load ![]() In Visual Basic 2015, an image can also be loaded at runtime using the FromFile method of the Image control, as shown in the following example. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |