I load some data from file:
GInputStream* input_stream;
GFile *file = g_file_new_for_path(file_path);
input_stream = g_file_read(file,generator_cancellable ,NULL);
g_input_stream_read(input_stream, buffer, sizeof (buffer),generator_cancellable,error);
How can i load g_input_stream_read function result to the GdkPixbufLoader object?
Thank you.
You need to create a new
GdkPixbufLoaderand pass the data you read fromGInputStreamto it:However, this makes sense if you perform reading asynchronously or in chunks (to e.g. show a progressively loaded JPEG or PNG). If you just read all the data at once in a blocking manner, use simpler
gdk_pixbuf_new_from_stream().