Loading...

How to draw & replace color ?

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

How to draw & replace color ?

Postby louis » Tue Mar 23, 2010 9:17 pm

Hi Loic,

I would like to draw a line or a circle in yellow color but only replace the white color to yellow. Is that possible ?
I tried to use SetROI and SwapColor (white to yellow), that works but that manages only rectangular areas. Lines may be oblique. Unless I swap pixel per pixel... Why not !

Louis
louis
 
Posts: 49
Joined: Tue Apr 28, 2009 6:18 pm

Re: How to draw & replace color ?

Postby 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
louis
 
Posts: 49
Joined: Tue Apr 28, 2009 6:18 pm


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron