Color Property

Measurement Studio User Interface

Color Property

Syntax

CWImage.Color

Data Type

Color

Purpose

Specifies the color of the image, or, if you are doing dynamic color substitution in Windows metafiles, the color in the image that you want to replace.

Remarks

For dynamic color substitution in Windows metafiles, use with the Substitute, SubstituteColor, and Tolerance properties.

Example

'Set button's off image to red
CWButton1.OffImage.CWImage.Color = vbRed

'Dynamic color substitution of metafiles
'Load the metafile into the OffImage of the CWButton
Set CWButton1.OffImage.CWImage.Picture = LoadPicture("c:\pics\stop.wmf")
'Replace all red in image with blue
CWButton1.OffImage.CWImage.Substitute = True
CWButton1.OffImage.CWImage.Color = vbRed
CWButton1.OffImage.CWImage.SubstituteColor = vbBlue
'Substitute only very close hue matches
CWButton1.OffImage.CWImage.Tolerance = 10

See Also

Substitute

SubstituteColor

Tolerance