Apng alpha channel

Discuss any general programming issues here
Post Reply
xabierpayet
Posts: 267
Joined: Fri Feb 24, 2012 9:34 am

Apng alpha channel

Post by xabierpayet »

how i can to know if an APNG animation have or not alphachannel, as i can do it with a single picture?
"isanim" don´t tell me nothing about this case
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Apng alpha channel

Post by airsoftsoftwair »

Have you tried to call IsPicture() on the APNG? Maybe it works because APNG is actually just a hacked PNG file :) Otherwise, do it like this:

Code: Select all

LoadAnim(1, "test.apng", {FromDisk = True})
havealpha = GetAttribute(#ANIM, 1, #ATTRHASALPHA)
FreeAnim(1)
This should be quite efficient because "FromDisk" is set to TRUE, i.e. no frames are actually loaded by LoadAnim().
xabierpayet
Posts: 267
Joined: Fri Feb 24, 2012 9:34 am

Re: Apng alpha channel

Post by xabierpayet »

work nice, but i wish a table with is anim instruction as ispicture have (if is possible)
another thing, i´m using brushes as sprites with a width of the sheet > of 30000 pixels, and displaybrushpart doesn´t work with them (only display the sprite placed in first position here), do you knows what´s the size limit in pixels of an image?
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Apng alpha channel

Post by airsoftsoftwair »

That's an OS limit. I think OS4 has a bitmap width limit of 16384 pixels or 32768 pixels. You can circumvent this by using the USEWPA argument, but then drawing will be a bit slower.
Post Reply