Re: [gtk-list] Re: Graphics widget



Raph Levien wrote:

> 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.

How about putting it in another thread?



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