Re: [gtk-list] Graphics widget
- From: Raph Levien <raph acm org>
- To: gtk-list redhat com
- cc: GTK Mailinglist <gtk-list redhat com>
- Subject: Re: [gtk-list] Graphics widget
- Date: Wed, 15 Oct 1997 16:23:44 -0700 (PDT)
On Wed, 15 Oct 1997, Sascha Ziemann wrote:
> Hi,
>
> does a graphics widget exist for GTK that can be used to show JPGs?
Yes. Use gzillabytesink, gzillaimgsink, gzillaimage, and gzillajpeg from the
latest gzilla release (available at www.gzilla.com). You'll also need the
IJG jpeg library (the same one that the GIMP uses). The invocation looks
something like this:
GzillaByteSink *bytesink;
GzillaImgSink *imgsink;
imgsink = gzilla_image_new (width, height, "", bg_color);
bytesink = gzilla_jpeg_new (imgsink);
/* Pack bytesink->widget into the container of your choice here. */
gzilla_bytesink_write (bytesink, buf, bufsize);
...
gzilla_bytesink_close (bytesink);
For large images, try to split up the bytesink_write calls into multiple
iterations of the idle loop - this will prevent the UI from stalling
while the image is being decoded - a fairly CPU intensive process.
Good luck!
Raph
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]