IonicWind Software

IWBasic => General Questions => Topic started by: Brian on July 26, 2021, 06:25:44 AM

Title: DevIL Image Library
Post by: Brian on July 26, 2021, 06:25:44 AM
Hi,
I don't know if anyone knows anything about the DevIL image library, but I am desperately trying to get it to show a GIF that has transparent pixels
Run the code, and it displays the GIF. Select Rotate from the menu, and it rotates OK. But neither views show the background as transparent
Any ideas?

Brian
Title: Re: DevIL Image Library
Post by: LarryMc on July 26, 2021, 06:54:32 AM
I've used it before but it's been a while. If someone else doesn't look into it for you I will after I get through dealing with my wife's funeral.
Title: Re: DevIL Image Library
Post by: Brian on July 26, 2021, 08:21:04 AM
No rush, Larry - you do what you have to do. I know I can load GIFs in IWB, but it's the rotate feature I am after

Brian
Title: Re: DevIL Image Library
Post by: Egil on July 29, 2021, 04:49:11 AM
I simply had to try your code, Brian.
There is something strange with your example.

First, I renamed your GIF so the compiled program did not find it,
The result was a checkered rectangle much less in size than your GIF. When trying to rotate it, it was rotaded anticlockwise.

Then, I gave your GIF the original name, resulting in clockwise rotation, but no transparency.

At last I edited your GIF, and gave it the same background color as the window RGB(219,219,219).
This make the rotated GIF appear as it has transparent background, but of course it is only an illusion.
But if rotated more than 45 degrees, the "transparency" seems to dissapear.

I have not yet found a user manual for the DevIL library, but wonder if you may have a memory allocation problem?


Egil
Title: Re: DevIL Image Library
Post by: Brian on July 29, 2021, 08:45:30 AM
Hi, Egil,

The chequered image is built in to the image library, and will be shown in response to various error conditions

I could paint the background with RGB 219, etc, myself and, indeed, have already done so. But the idea is to have a transparent background so that the loaded image can move over other images, and show those images through the transparency

I have also had angle errors. I think it depends on what type of image you are loading - bitmaps seem to be different than GIF images in order of how they are rotated

I found a site that lists all the commands, which was handy:
http://www-f9.ijs.si/~matevz/docs/DevIL/apireference.html

Anyway, it keeps the grey matter ticking over!

Brian