Re: Getting the color of a pixel
- From: Bryan Brown <bbrown saltmine radix net>
- To: gtk-app-devel-list gnome org
- Subject: Re: Getting the color of a pixel
- Date: Tue, 3 Dec 2002 06:45:56 -0500 (EST)
I was able to do what I needed using the gdk_image* functions, retrieving
only the necessary portions of the drawing area into an image from which
to get the pixel colors. I then converted the image corrdinates back to
the drawing area coordinates.
Of course, it's vitally necessary to limit the amount of data retrieved
via each call to gdk_image_get because the performance can really suffer
if you overdo it. As a first cut I tried retrieving the entire drawing
area image with each call, and the resulting performance was
a-g-o-n-i-z-i-n-g-l-y s-l-o-w. Performace was peppy, however, when I just
retrieved the pieces I actually needed.
Havoc's book was really helpful for this.
Regards,
Bryan
*---------------------------------------------------------------
* Bryan Brown <*> bbrown radix net
* http://www.radix.net/~bbrown
*---------------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]