Re: pixel drawing
- From: John Cupitt <jcupitt gmail com>
- To: Andreas Bentlage <abent gmx de>
- Cc: gtk-list gnome org
- Subject: Re: pixel drawing
- Date: Thu, 30 Jun 2005 18:09:52 +0100
On 6/28/05, Andreas Bentlage <abent gmx de> wrote:
> i have the following 2 arrays.
> gfloat pixel[6000][1] = x[n]
> gfloat pixel[6000][2] = y[n]
> this 2 arrays contains the x/y values for 6000 rectangles
> drawn on a pixmap. Now my problem ...
> with button_press_event i catch the current x/y positions
> from screen. What i want is to draw the given pixels from
> my arrays in a different color when i'm close to it with my mouse.
In the button_press handler, save the mouse x/y position somewhere and
then trigger an expose. In the expose handler, redraw all your points
calculating the colour from the distance between the point and the
saved click position.
If it's too slow, you can start to do your own clipping depending on
the distance function.
John
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]