Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 03/20/26 07:00
Black Book, 4th edition
by jcl. 03/17/26 09:28
Trying to get started...
by Lukudo. 03/16/26 09:08
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 5,318 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
mredit, vestriaa, Lukudo, mldenoiser, the1
19204 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,089
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,089
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