Re: possibility of export image?
- From: Oliver Nittka <nittka esem com>
- To: oedipus <alexander arnoldt gmx de>
- Cc: gtkmm-list gnome org
- Subject: Re: possibility of export image?
- Date: Thu, 23 Nov 2006 10:00:33 +0100
oedipus schrieb:
> Hi,
>
> is it possible with the gtkmm libary to export a Gtk::Image or
> Gtk::Drawingarea into some kind of image format, like jpg or png? If that is
"widget" is a Gtk::Image* or a Gtk::DrawingArea*:
Glib::RefPtr<Gdk::Drawable> drwbl = widget->get_window();
Glib::RefPtr<Gdk::Pixbuf> pxb;
pxb = Gdk::Pixbuf::create(drwbl, drwbl->get_colormap(),
0, 0, 0, 0,
widget->get_width(),widget->get_height());
try {
pxb->save("Image.png", "png");
}
catch (Glib::Exception &e) {
std::cerr << "could not save: " << e.what() << std::endl;
}
> Thank you in advance
> Alex
HTH
--o
--
Oliver Nittka
ESEM Grünau GmbH & Co. KG
Dornierstraße 6, 88677 Markdorf/Germany
phone: +49 7544 9583-25, fax: +49 7544 9583-60
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]