Visibility against an unknown background

Sergei Organov osv at javad.com
Tue Oct 24 17:37:06 CEST 2006


"Odalrick" <odalrick at hotmail.com> writes:

> I need to draw visible lines on pictures with wxPython. That means I
> can't simply use, for instance, a black line since it wont be visible
> on a black or dark picture.
>
> Painting applications like the GIMP accomplish this by altering the
> colour of the line based on the colour of the pixel it covers, but the
> only way I can think of doing that is getting each pixel, transforming
> the colour then painting it on the screen, which seems like a horribly
> inefficient way do it.

There is a better way to do it. Check if the toolkit has line drawing
mode that XORs the line color with the background, then draw using this
mode and white color of the line.

-- Sergei.




More information about the Python-list mailing list