WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

replace

Replaces all pixels within the specified rectangle that are of one colour with a new colour.
Syntax
GraphicDisplay. replace(fromColor1,toColor1,x,y,w,h)
GraphicDisplay. replace(fromColor2,toColor2,x,y,w,h)
Where GraphicDisplay is the name you have given to the device in Project Designer.
Parameters
TypeNameDescription
'fromColor1'
Replace pixels of this colour
'toColor1'
The new colour to be used
'x'
The x value across the screen.
'y'
The y value down the screen.
'w'
The rectangle width.
'h'
The rectangle height.
'fromColor2'
Replace pixels of this colour
'toColor2'
The new colour to be used
Returns
None
Example
To change any red pixels to green pixels in the rectangle whose top left corner is at 10,11 and is 20 pixels wide and 15 high:-
COLOR red = MAKE_COLOR_RGB( 255,0,0 );
COLOR green = MAKE_COLOR_RGB( 0,255,0 );
display.replace(&red, &green, 10,11, 20,15);
Or, if using the C++ Color class, then:-
Color red( 255,0,0 );
Color green( 0,255,0 );
display.replace(red, green, 10,11, 20,15);

 

 

Valid XHTML 1.0 Transitional