delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/02/09:53:36

From: "Kalum Somaratna aka Grendel" <kalum AT newmail DOT net>
To: djgpp AT delorie DOT com
Date: Sun, 2 Jan 2000 19:37:33 +0600
MIME-Version: 1.0
Subject: Re: transparent bitmaps
In-reply-to: <84nbap$gdo$1@planja.arnes.si>
X-mailer: Pegasus Mail for Win32 (v3.12)
Message-ID: <94685661201@out.newmail.net>
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 2 Jan 00, at 12:03, Matej wrote:

> > Just pick a color that you want to be transparent, most people
> > choose 255 or just 0, and make a BMP displayer that skips the pixels
> > with that value.
> 
> 
> Yes, but how to do it? Can you give me an example?
> Thanks

Hi!,

I am not quite sure whether you are asking about how to create 
transparent images or how to write a blitting routine that handles 
transparent pixels. If you want to create transparent images like 
the ones you see on the web pages then then I hope the following  
helps you.

GIF files support transparency. This is how you do it, If you load a 
GIF file to your paint program there should be a menu option which 
would allow you to select a single colour from your image which 
would be marked as transparent. 

So if your 256 colour image had a background of purple and if 
purple was palette entry 15 (of the total 256 palette entries) you 
would select purple from the palette and you've got a transparent 
GIF. All the pixels in the GIF which are drawn with entry 15 (purple 
in this case) would not be drawn by the program which draws the 
GIF (like Netscape etc if your thinking of a web page). So since 
this pixels are not drawn your background will show through these 
areas and you've got your transparency.

Actually some paint programs allow you to just simply select the 
transparent colour using a color picker from the image.

I use Gif Constructionset Professional from alchemy mindworks to 
create my GIF's. It's Never expiring shareware so you might try 
getting it. (I've forgotten the URL, Please do a search).


Hope This Help's
Kalum




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019