imageXORDrawingMode

Sets the paint mode of the image to alternate between the image's current color and the new specified color.

imageXORDrawingMode(image, color) → returns void

Member Function Syntax

someImage.xorDrawingMode(color)

Argument Reference

image string
Required

The image on which this operation is performed.

color string
Required
Default: black

XOR alternation color. The values can be:
- Hexadecimal value of the RGB color. For example, specify the color white as ##FFFFFF or FFFFFF.
- String value of color (for example, black, red, green).
- List of three numbers for (R,G,B) values. Each value must be in the range 0-255.

Examples
Sample code invoking the imageXORDrawingMode function

CF 11+ Create a new image, set the xorDrawingMode to be the background color, draw a white rectangle, set drawing color to white, draw some points on the image. Where point pixels are the same as background color use XOR color

imgObj = imageNew("",152,152,"rgb","149c82");
imgObj.xorDrawingMode("149c82");
imgObj.setDrawingColor("white");
imgObj.drawRect(50,50,50,50,"yes");
for (i=1;i LTE 100;i=i+1) {
	x = randRange(0,152);
	y = randRange(0,152);
	imgObj.drawPoint(x,y);
}
cfimage(action="writeToBrowser", source=imgObj);

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub