PictureClip Control

               

The PictureClip control allows you to select an area of a source bitmap and then display the image of that area in a form or picture box. PictureClip controls are invisible at run time. This is a typical bitmap that might be used in the PictureClip control:

File Name

PICCLP32.OCX

Class Name

PictureClip

Remarks

The PictureClip control provides an efficient mechanism for storing multiple picture resources. Instead of using multiple bitmaps or icons, create a source bitmap that contains all the icon images required by your application. When you need to display an individual icon, use the PictureClip control to select the region in the source bitmap that contains that icon.

For example, you could use this control to store all the images needed to display a toolbox for your application. It is more efficient to store all of the toolbox images in a single PictureClip control than it is to store each image in a separate picture box. To do this, first create a source bitmap that contains all of the toolbar icons. The picture at the top of this topic is an example of such a bitmap.

Note   For international localized applications, resource files are sometimes a more useful way to store bitmaps. For more information, refer to Chapter 16, "International Issues," in the Visual Basic Programmer's Guide.

You can specify the clipping region in the source bitmap in one of two ways:

Load the source bitmap into the PictureClip control using the Picture property. You can load only bitmap (.bmp) files into the PictureClip control.

Distribution Note   When you create and distribute applications that use the PictureClip control, you should install PicClp32.ocx in the customer's Microsoft Windows System or System32 subdirectory. The Setup Kit included with Visual Basic provides tools to help you write setup programs that install your applications correctly.