delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/03/13:30:56

From: "Damian Yerrick" <NOSP AT Msnews@pineight.8m.com>
Newsgroups: comp.os.msdos.djgpp
References: <94685661201 AT out DOT newmail DOT net> <84nsgt$p1r$1 AT planja DOT arnes DOT si>
Subject: Re: transparent bitmaps
Lines: 46
Organization: Pin Eight Software <http://pineight.8m.com/>
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Message-ID: <i7Qb4.2840$W41.58040@dfiatx1-snr1.gtei.net>
X-Trace: +rvUKgSQ2cCEuL4+BW66ai6patJkqSZKs/ZqBZU3084cuDQKyQDl0IjqnuE/fz46JbNX+c7HfrL4!IuV0nKXVkQpZHm04MBMnrYFXpRsmo9fhL5zFiy8f9qsrJ1IOwsM7rcACdkehdTWCBTk6cyLtBw==
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Sun, 02 Jan 2000 22:16:46 GMT
Distribution: world
Date: Sun, 02 Jan 2000 22:16:46 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Matej" <matej DOT baric AT guest DOT arnes DOT si> wrote:
> Let's say I draw a red circle with black background in a program like
Paint

Don't use M$ Paint to make index-color graphics. It does not
have a way to control the index palette. Use the GIMP (if you
have Linux) or NeoPaint for Windows ($60) or Paint Shop Pro
($100 IIRC).

> and I save it to be a .bmp file (or .pcx, but not gif!).

Good. GIF only uses Uni$ys's sucky LZW algorithm.

> Then, I write a program with a colorful background and
> want my program to display only that red circle without the
> black background. So, how to write that routine to
> show only the red circle?

First, you have tp make the background index color 0. This may
or may not be black, depending on the index palette in the image.

I'd say if you want to know how to do something in graphics,
look at the Allegro sources. Or play with this:

for(y = 0; y < height; y++)
  for(x = 0; x < width; x++)
    if(source[y][x]) // only copy pixels equal to 0
      dest[y + destY][x + destX] = source[y][x];


--
Damian Yerrick    http://yerricde.tripod.com/
View full .sig:  http://www.rose-hulman.edu/~yerricde/sig.html










and now you must pay...


- Raw text -


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