ZColorChange

(Engine-Level Function)

Description: Changes one color within a region to another color. This is an older function, intended for use on objects that used a color range, such as pipes prior to release 11 of VTScada.
Returns: Nothing
Usage: Steady State only.
Function Groups: Color,  Graphics
Related to: GetSystemColor | PixelColor
Format: ZColorChange(Left, Bottom, Right, Top, Original, New)
Parameters:  
Left  
Required. Any numeric expression for the left side coordinate of the change region.
Bottom  
Required. Any numeric expression for the bottom side coordinate of the change region.
Right  
Required. Any numeric expression for the right side coordinate of the change region.
Top  
Required. Any numeric expression for the top side coordinate of the change region.
Original  
Required. Any one of the colors of the existing region.
New  
Required. Any one of the colors which will replace the old.
Comments: Although this is a layered graphic, it cannot be edited using the Idea Studio. It is for use within text mode editing only. A solid pattern should be used if you wish to change the color back to its original color.

The order of graphics statements are an important factor in determining which objects will have their color changed. The ZColorChange function affects all objects underneath it, which means, any object whose graphic statement is before the ZColorChange statement (including images that are displayed using a Load statement). Any object whose statement follows the ZColorChange statement will be unaffected. The background color will also be affected by ZColorChange.

Example:

ZBar(100, 500, 500, 40, 12 { Draws a large red bar });
ZColorChange(10, 210, 210, 10 { Bounding box for change },
             12, 14 { Change all red in to yellow }); 
ZBar(20, 60, 60, 20, 12 { Draws a small red bar });

The ZColorChange statement here will cause the upper left corner of the first large bar to be yellow, while the rest of the bar (outside the bounding box for ZColorChange) will remain red. The second bar, although drawn inside of the ZColorChange's bounding box, will be drawn in red, not yellow, because its statement follows the statement that effects the color change.