Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » semi-transparent bitmap

This thread is locked; no one can reply to it. rss feed Print
semi-transparent bitmap
Albin Engström
Member #8,110
December 2006
avatar

How do i load and use a semi-transparent bitmap?, i could not find the answer on the forum so instead i'm making a new thread on the subject.

ngiacomelli
Member #5,114
October 2004

You colour the transparent bitmap regions as RGB 255,0,255 (magic pink). Then you use either of these functions to blit it:

You load the bitmap as normal.

Albin Engström
Member #8,110
December 2006
avatar

^^'.. i know that much.. i meant:
how (if it's possible) can i draw some sort of image that's not 100% transparent(parts of it).

gnolam
Member #2,030
March 2002
avatar

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Albin Engström
Member #8,110
December 2006
avatar

I guess i didn't give such an good explanation..
I want to load a picture where some pixels are transparent and others are not.
i don't want the whole picture drawn with the same transparency.

I'm wondering if this is possible.

Ceagon Xylas
Member #5,495
February 2005
avatar

Could you make an example in photoshop? (Or another similar program)

Albin Engström
Member #8,110
December 2006
avatar

I've added an attachment, it's an example of what i'm trying to do, where the chess-board-look-alike background is the transparency, of course the bitmap can't be used but i'm wondering if this effect is possible with allegro and if so in what kind of format should the image be stored?.

gnolam
Member #2,030
March 2002
avatar

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Milan Mimica
Member #3,877
September 2003
avatar

Quote:

How do i load and use a semi-transparent bitmap?

set_color_conversion(COLORCONV_NONE);
BITMAP *bmp = load_tga(path, NULL);

Evert
Member #794
November 2000
avatar

For reference, the search term you want is translucent.

Albin Engström
Member #8,110
December 2006
avatar

I thank thee, :).

Go to: