Working with Pictures
Working with Pictures |
Description of working with pictures for the Tablet PC.
This topic describes how to adjust pictures using the SizeMode property, and how to display pictures in Microsoft® Visual Studio® .NET and Microsoft Visual Basic® 6.0.
The SizeMode Property
You can specify how an image fits in the control with the SizeMode property. The SizeMode property is available in both the Managed Library and in the Automation Library. With SizeMode you can:
- Re-size the control borders to fit an image.
- Stretch an image to fit the control borders.
- Center an image within the control borders.
- Anchor an image to the upper left of the control without resizing the image or control (in which case some of the image may not be viewable).
Working with Pictures in Visual Studio .NET
To display an image at design time in Visual Studio .NET
- Draw an InkPicture control on a form, or double-click the InkPicture control in the Toolbox.
- In the Properties window, select the Image property, then click the ellipsis button to open the Open dialog box.
- If you are looking for a specific file type (for example, .jpg files), select it in the Files of type box.
- Select the file you want to display.
To clear the picture at design time
- In the Properties window, select the Image property and right-click the thumbnail image.
- Choose Reset.
The InkPicture control is displayed by default without any borders. You can provide a standard or three-dimensional border using the BorderStyle property to distinguish the InkPicture box from the rest of the form, even if it contains no image.
You can display an image at run time with the Image object's FromFile method:
ctlInkPicture.Image = Image.FromFile("c:\myImageFile")
You can also include a background image with the BackgroundImage property; however, it cannot be resized.
Working with Pictures in Visual Basic 6.0
To display an image at design time in Visual Basic 6.0
- Draw an InkPicture control on a form, or double-click the InkPicture control in the Toolbox.
- In the Properties window, select the Picture property, then click the ellipsis button to open the Open dialog box.
- If you are looking for a specific file type (for example, .jpg files), select it in the Files of type box.
- Select the file you want to display.
To clear the picture at design time
- In the Properties window, select the Picture property.
- Position the cursor in the right hand column, and press Delete.
You can display an image at run time with the LoadPicture method:
ctlInkPicture.Picture = LoadPicture("c:\myImageFile")