开发者

GTK+ buffer in g_input_stream_read

开发者 https://www.devze.com 2023-01-02 05:18 出处:网络
I load data with function: gssizeg_input_stream_read(GInputStream *开发者_如何转开发stream, void *buffer, gsize count,

I load data with function:

gssize          g_input_stream_read    (GInputStream *开发者_如何转开发stream,
                                        void *buffer, gsize count,
                                        GCancellable *cancellable,
                                        GError **error);

What is ma value of buffer parameter. How can I know what should be equal to buffer?

I make:

#define LOAD_BUFFER_SIZE 65536

But when i try to load image, only visible part of the image.

Thank you.


The buffer is a pointer to the memory you have allocated to contain what g_input_stream_read reads. It must be big enough to contain count bytes.

Could you expand this question, by showing with code samples how you are allocating the memory for buffer and how you called g_input_stream_read exactly?

Here is documentation on using g_input_stream_read.

0

精彩评论

暂无评论...
验证码 换一张
取 消