Presentation is loading. Please wait.

Presentation is loading. Please wait.

PictureBoxes A picture box displays an image. You can find it in toolbox, drag it in the form Images can be.bmp,.gif,.jpg, jpeg GIF and JPEG files are.

Similar presentations


Presentation on theme: "PictureBoxes A picture box displays an image. You can find it in toolbox, drag it in the form Images can be.bmp,.gif,.jpg, jpeg GIF and JPEG files are."— Presentation transcript:

1 PictureBoxes A picture box displays an image. You can find it in toolbox, drag it in the form Images can be.bmp,.gif,.jpg, jpeg GIF and JPEG files are widely used image file format Properties Image: image to display in the picture box SizeMode:controls image sizing and positioning

2 SizeMode Normal: (default) puts image in top- left corner of picture box StretchImage:resizes image to fit in picture box CenterImage: puts image in middle AtuoSize: resizes picture box to hold image

3 Design GUI Design GUI that contains one PictureBox and three labels( labels show name of the images, set the anchor property of the PictureBox so that it resize when the form resize

4 Download three pictures if you have image files with you, you can use them If you don’t have any image file, download three images from internet Create a folder in you project folder, name the folder as image Save three image files in the image folder

5 MouseEnter, MouseLeave Write proper code so that When mouse enter the first label, the pictureBox will show the first picture When mouse enter the second label, it will show the second picture When mouse enter the third label, it will show the third label Read next slide for help

6 Set the image property To set the image property to an image file imagePictureBox->Image = Image::FromFile(String::Concat(Directory::GetCurr entDirectory(), S”\\image\\myboy.jpeg”) ; Where imagePictureBox is the name of control (The PictureBox) Directory::GetCurrentDirectory() retrieve the current directory name, ie. Where you create your project image is the folder I asked you to create and put your image files in it. Myboy.jpeg is example of image file name, you need to change to your image file names


Download ppt "PictureBoxes A picture box displays an image. You can find it in toolbox, drag it in the form Images can be.bmp,.gif,.jpg, jpeg GIF and JPEG files are."

Similar presentations


Ads by Google