Re: Saving the map as image



On Thu, Jan 6, 2011 at 21:04, Patrick Salecker <patty9999 gmx de> wrote:
> Hi everyone,
>
> I want to save the visible part of the map as an image, what is the best way
> to do it?
> I tried it by using gtk.widget.get_snapshot, but then the area of the map is
> blank.

I haven't tried it myself but something like this might work:

1. get ChamplainView from the GtkChamplainEmbed widget by
gtk_champlain_embed_get_view()
2. As ChamplainView is a ClutterActor, you can create a texture from
it by  clutter_texture_new_from_actor()
3. Get the CoglTexture from ClutterTexture by clutter_texture_get_cogl_texture()
4. Get the image data by cogl_texture_get_data()
5. Use GdkPixbufLoader to load the data and save it with gdk_pixbuf_save()

I'm not sure at all this will work and I'm not sure this is the
easiest way either. If someone knows a better way, please let us know.

Cheers,

Jiri


>
> Best regards,
> Patrick Salecker
> _______________________________________________
> libchamplain-list mailing list
> libchamplain-list gnome org
> http://mail.gnome.org/mailman/listinfo/libchamplain-list
>


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