Visual Basic: Windows Controls

Overlay Method

See Also    Example    Applies To

Draws one image from a ListImages collection over another, and returns the result.

Syntax

object.Overlay(index1, index2)

The Overlay method syntax has these parts:

Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
index1 Required. An integer (Index property) or unique string (Key property) that specifies the image to be overlaid.
index2 Required. An integer (Index property) or unique string (Key property) that specifies the image to be drawn over the object specified in index1. The color of the image that matches the MaskColor property is made transparent. If no color matches, the image is drawn opaquely over the other image.

Remarks

Use the Overlay method in conjunction with the MaskColor property to create a single image from two disparate images. The Overlay method imposes one bitmap over another to create a third, composite image. The MaskColor property determines which color of the overlaying image is transparent.

The index can be either an index or a key. For example, to overlay the first picture in the collection with the second:

Set Picture1.Picture = ImageList1.Overlay(1,2) ' Reference by Index.
   'Or reference by Key property.
Set Picture1.Picture = ImageList1.Overlay("First", "Second")