Apng alpha channel

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

Apng alpha channel

Post by xabierpayet » Thu Jun 09, 2016 11:16 pm

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: 2913
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Apng alpha channel

Post by airsoftsoftwair » Sat Jun 11, 2016 10:00 pm

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: 176
Joined: Fri Feb 24, 2012 9:34 am

Re: Apng alpha channel

Post by xabierpayet » Sun Jun 12, 2016 4:21 am

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: 2913
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Apng alpha channel

Post by airsoftsoftwair » Tue Jun 14, 2016 8:51 pm

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