Re: I'm looking for a drag-and-zoom box. Where to start?



Hello,

You might start by looking at the GTK demo where it has a window that comes up that has a really simple pen up pen down example on it(I cant remember the exact name). It shows how to catch signals of mouse up and down on a gtk drawing area without polling the cpu for them. As for the rectangle you could take a snap shot of the drawing area that the mouse has drawn a box over and manipulate with the gdk pixbuf functions:

http://developer.gnome.org/doc/API/2.0/gdk/gdk-Pixbufs.html

i.e gdk_pixbuf_get_from_drawable ()

and then run it through what ever functions you need to make it look funky and slap it back on the draw area->window.

i.e. gdk_draw_pixbuf ()

Good luck!

Jimmy





On Oct 20, 2004, at 10:03 AM, Paul van Haren wrote:

Hi,

In my application I have a map, implemented as a GdkPixbuf, that I can manipulate and display. Now I want to extend this app with a zoom function as follows: the user clicks left and draws a non-filled rectangle while keeping the left button pressed. As soon as the left mouse button is depressed, the action is completed and I can execute the zoom function. The new view will show what is inside the drawn rectangle.

However, I have no idea where to start to look for such a function. Should I be using low level primitives such as gdk_draw_rectangle and implement by own backing store, or is there a more convenient way to get it implemented.

Any help is appreciated. Thank, Paul van Haren
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]