Paul McNett wrote: > Are you saying I'll be able to follow the code and figure out how to enable > HitTest > for a color depth of 16?
I think so. There is a color generator in FloatCanvas.py. When I first wrote it, I tried to accommodate other color depths. I put in a skip parameter, so it would skip colors, and if they were far apart, I figured that they would be distinct in 16 bit (and 8, even). However, that didn't end up working, and I think I know why (if you search the archives of this list, I think you'll find discussion) The problem is then wx is natively 24 bit, so when you create a color in 24 bit, it gets converted to 16 bit, then, when you get the pixel color, it gets converted back into 24, but it may not be exactly the same 24bit color: (120, 10, 200) might come back as (121,11,101)-- I made that up, but I hope you get the idea. I think the solution is for the color generator to actually draw the color to a small bitmap, then check the pixel color, and see what it comes back as -- then store that color as the index for the hot-test. Or maybe it would be easier to test if the color comes back the same, and reject it if it doesn't, then no other code would have to change. Good luck! -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception _______________________________________________ FloatCanvas mailing list [email protected] http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
