by louis » Thu Mar 25, 2010 12:51 pm
Finally, I use SetROI and SwapColor but not pixel per pixel. As I would like to highlight some parts of a text like with a highlighter, I simulate a highlighted line with a loop on rectangles instead of a loop on pixels. The rectangle represents the width and the height of a pen. So, I replace with SwapColor the white by, for example, yellow.
The other solution Drawline with a certain transparency (alpha value of ARGB <> 255) does not give the same result : the colors (black color of the text and yellow backcolor) are not exactly black and yellow. That is different from the highlight.
Moreover, if I want to suppress the highlight, I swap from yellow to white. To avoid the deletion of original yellow pixels in the drawing, I swap from white to RGB(255,255,1) which is very closed to yellow, so that I can swap from this color to white. That works properly except if there are original RGB(255,255,1) pixels ! But the chance is very small ...
Louis