Random error showing an image


in my app I'm loading an pixBuf with the function

image = Gdk::Pixbuf::create_from_file("path and dir of picture);

after the loading I display it with a queue_redraw and in the expose_event handler it is displayed with

image->scale_simple(image->get_width() - scaleFactor, image->get_height() - scaleFactor, Gdk::INTERP_BILINEAR)->render_to_drawable(win,drawingRegion->get_style()->get_black_gc(), 0,0,0,0,image->get_width() - scaleFactor, image->get_height()- scaleFactor,

Normally this goes well, but sometimes I get the error and crash of the app The errmsg is : GdkPixbuf-CRITICAL **: gdk_pixbuf_scale_simple: assertion `dest_width > 0' failed.

What is causing this error and how to avoid it??

Kees Kling

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