Jump to content

A GIF image in multiple gwin Imagebox handlers


wctltya

Recommended Posts

Hi,

I have to render a GIF image in many image boxes. So far I'm doing it in a loop, for example

GHandle image_handle[NumberOf];

for(i = 0; i < NumberOf; i++) {

....

image_handle = gwinImageCreate(0, &wi.g);

gwinImageOpenFile(image_handle, "image_file.gif");

}

Is there another way, open file once, then link it to the imagebox handlers?

I know that there are several other function to open image file once, then to draw it, etc, but I don't see a function to link it to the imagebox handler.

I don't have frame buffer, the screen is rendered directly in the display memory.

 

Link to comment
Share on other sites

The imagebox widget (in the code the GImageObject structure) contains the gImage member.
I didn't try it but you should be able to just open a file regularly and load it into a gImage object (named gdispImage in older versions of the library) and then assign that to the imagebox widget's gImage member. Afterwards you have to trigger a re-render of the imagebox widget.

Note that the underlying widget object should always be treated as a blackbox and you should only use the GWIN highlevel API passing GHandle around.
If you want this functionality I'd recommend that you implement a proper API call for this in the imagebox widget.
Pull requests are of course welcome ?

 

Link to comment
Share on other sites

Thank you Joel,

9 hours ago, Joel Bodenmann said:

I didn't try it but you should be able to just open a file regularly and load it into a gImage object (named gdispImage in older versions of the library) and then assign that to the imagebox widget's gImage member. Afterwards you have to trigger a re-render of the imagebox widget.

But, could you give an example, please? I'm using version 2.8.

Edited by wctltya
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...