[Gambas-user] get color from drawingarea point
Jussi Lahtinen
jussi.lahtinen at ...626...
Wed Apr 22 22:14:10 CEST 2009
To be more clear...
this to outside of loop:
tmpImage = DrawingArea1.Grab().Image
this to inside of loop:
c = tmpImage[x, y]
But like Benoit said, it's not necessary in sync with DrawingArea
internal buffer... depends on situation.
I have used that kind of code with pictures, to gain more speed;
tmpImage = SomePicture.Image
Jussi
2009/4/22 Benoît Minisini <gambas at ...1...>:
>> hi,
>> I need to get the color of point into drawingaera.
>> I use "c = DrawingArea1.Grab().Image[x, y]"
>> This works well, but for a Area of 512 x 512 points it needs more than 10
>> minutes
>> How can I accelerate this function?
>>
>> kind regards
>> Jürgen
>
> On X-Window, you don't have access to the pixel data of the buffer used by a
> DrawingArea, so it will always be slow.
>
> To be fast, you must have an Image buffer and keep it in sync with the
> DrawingArea internal buffer. Not easy...
>
> Regards,
>
> --
> Benoît
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list