Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
When does a bitmap really has an alpha channel? #389616
12/16/11 11:30
12/16/11 11:30
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Hi,

I encountered, that when I load a 24bit TGA from file, that A8 returns as format 8888, while bytespp is = 3; this is, I guess, because of the conversion for being used with DirectX or so... right?

Well, because I am writing some functions for saving BMAP*'s to file, I came up with this solution:

Code:
BOOL bUseAlpha = (((format == 8888) || (format == 1555) || (format == 4444)) && (b->bytespp == 4));



So, whenever I get a format that possibly implicates an alpha channel, I also require the (original) bytespp field to be = 4.

Is this correct for all loaded images from file and all procedurally generated images?

Last edited by HeelX; 12/16/11 11:30.
Re: When does a bitmap really has an alpha channel? [Re: HeelX] #389626
12/16/11 13:24
12/16/11 13:24
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
DirectX loads all images in the format that is used by the 3D hardware. So there is no fixed rule which format you get. It depends on your hardware.

I don't think that there is a 3D card that would support the 888 format, so a 24 bit image is most likely loaded in 8888 format, even when the image contains no alpha channel.

Re: When does a bitmap really has an alpha channel? [Re: jcl] #389628
12/16/11 13:28
12/16/11 13:28
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Thanks for the answer... I found out, that DirectX stores BMP and PCX images as 888, though.


Moderated by  old_bill, Tobias 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1