MaskColor Property

       

Returns or sets the color used to create masks for an ImageList control.

Syntax

object.MaskColor [ = color]

The MaskColor property syntax has these parts:

Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
color A value or constant that determines the color used to create masks. You can specify colors using either Visual Basic intrinsic constants, the QBColor function, or the RGB function.

Remarks

Every image in a ListImages collection has a corresponding mask associated with it. The mask is a monochrome image derived from the image itself, automatically generated using the MaskColor property as the specific color of the mask. This mask is not used directly, but is applied to the original bitmap in graphical operations such as the Overlay and Draw methods. For example, the MaskColor property determines which color of an image will be transparent in the Overlay method.

If the system colors change, then the color which is transparent will change, making the look of your picture unpredictable. It is good programming practice to use non-system colors.