I never used drawing areas, but here are my suggestions.

First, does the drawing area resize? If it does, all you need to do is
to change the code which draws the image to use the drawing area's
dimensions, and scale the image accordingly (I don't know how to do
that, but I'm sure Cairo can help. In the worst case, from personal
experience I know OpenGL can do that, if you have no choice...).

If the drawing area doesn't resize, try to put it in a GtkGrid.

If it doesn't help - maybe you can removing the aspect frame and
calculating the image dimensions manually.

If it still doesn't work, I suggest you try asking on gtk-l...@gnome.org
and have some GTK experts give you ideas.

On ש', 2013-06-22 at 08:49 -0700, Kip Warner wrote:
> On Sat, 2013-06-22 at 11:33 +0300, אנטולי קרסנר wrote:
> > The code looks fine. I think the problem is that scaling images are
> > rarely used in GUI. Usually, they scale to fixed sizes and not directly
> > depend on a container scaling to arbitrary size. This is probably why
> > getting the result you want is not easy.
> 
> Hey Tom. Yes, definitely the resizing is the difficulty. It's amazing
> how much time I've spent on just trying to get the image to resize.
> 
> > Try the canvas idea. You can probably use any simple drawing area widget
> > (I never used one personally) from Gtk or Cairo.
> 
> This is what I've come up with so far. The image paints on the
> DrawingArea properly, but it doesn't resize at all when I resize the
> parent window.
> 
>         <http://pastebin.com/Mj7bTJLh>
> 


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to