In my testing with the latest wxpython 2.5
I notcied that the following line takes some time to do:
lightness = dc.GetPixel(x, y).Red()
It adds changes a normal script that, without the dc Pixel, takes about 6 seconds to run and changes it to 110 seconds. Is there another way that I can get the color of a pixel without having the overhead?
In my testing with the latest wxpython 2.5
I notcied that the following line takes some time to do:
lightness = dc.GetPixel(x, y).Red()
It adds changes a normal script that, without the dc Pixel, takes about 6 seconds to run and changes it to 110 seconds. Is there another way that I can get the color of a pixel without having the overhead?
The speed will probably vary based on what kind of DC that it is and also which platform you are on. As far as speeding it up probably the only way to to keep track of the colour some other way. If there is no way to do that then anohter approach might work depending on what your needs are. For example if you need to traverse the whole DC then blitting to a memoryDC and then converting its bitmap to an wx.Image and accessing the colors from the image may give enough of a boost to justify the conversion to image. Or perhaps just using GetPixel on the memory dc will be fast enough.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!