Substitute Property
Syntax
CWImage.Substitute
Data Type
Purpose
Specifies that you want to perform dynamic color substitution in the metafile image if set to True.
Remarks
You can perform dynamic color substitution only in Windows metafiles. Use the Color, SubstituteColor, and Tolerance properties to specify the color you want to replace, the replacement color, and the tolerance at which to match the color.
Example
'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