Re: Zooming in GtkDrawingArea
- From: Olexiy Avramchenko <ath beast stu cn ua>
- To: gao chaowei <chaoweigao hotmail com>
- Cc: gtk-list gnome org
- Subject: Re: Zooming in GtkDrawingArea
- Date: Mon, 09 Sep 2002 17:34:34 +0300
gao chaowei wrote:
> I hope i get help here. I put a message several days ago, untill now i
> have not seen response. I feel worry because my supervisor ...
> My Program:
>
> GtkDrawingArea darea;
Allocate pixmap (on configure event, for example).
>
> draw_arc(....);
> ...
Draw pixmap.
>
> Finally a tree is displayed(maybe large).
>
> My question is:
>
> How can i zoom in or zoom out what i have drawing in an efficient way.
> If other way can achieve this goal. Anybody have idea? Wait for your
> help!!
Zoom is possible via pixbuf. Make pixbuf from pixmap
(gdk_pixbuf_get_from_drawable() function).
Scale pixbuf to another pixbuf with a preffered size
(gdk_pixbuf_scale*() functions).
Draw scaled pixbuf to drawable you like (drawing area window on expose
event, or
another pixmap).
"gtk-doc/gdk/gdk-drawing-primitives.html"
"gtk-doc/gdk/gdk-pixbufs.html"
"gtk-doc/gdk-pixbuf/gdk-pixbuf-scaling.html"
Olexiy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]