🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2766

Re: animation in Windows?

#2766
From: Jerry Shekhel
Date: Mon, 20 May 1991 16:16
40 lines
2492 bytes
neves@aristotle.ils.nwu.edu (David Neves) writes:
>
>We want to do some simple animation in Windows.  If anyone has some
>pointers on this I would appreciate them.
>
>One way we are considering is to prepare several bitmapped objects and
>bitblt them (using BITBLT) to a complicated bitmapped background.  The
>problem as I perceive it is how to specify the part of the bitmap you
>want copied to the screen.  For example, lets say you have a donut
>picture and want to send it to the screen.  The bitmap of the donut is
>rectangular but the object is circular and it has an interior circle
>that also must show the background.  Is there some secret transparent
>color that one can use to construct the bitmap?  Or?
>

I have written a Windows game which I will be releasing as shareware shortly,
and I had exactly the same problem.  Fortunately, I came up with a solution.

What you want to do is this.  For each bitmap you need to display, you also
create another, called the 'mask'.  The mask is black wherever you want your
bitmap to overlay the background, and white wherever you want the background
to show through.  Now, to display the bitmap, you first BITBLT the mask
in SRCAND mode, and then BITBLT the bitmap in SRCPAINT mode.  Of course, if
you then want to move the bitmap, you'll have to restore the background bits
first.

Hope this helped!

>
>-thanks, david
>
--
+-------------------+----------------------+---------------------------------+
| JERRY J. SHEKHEL  | POLYGEN CORPORATION  | When I was young, I had to walk |
| Drummers do it... | Waltham, MA USA      | to school and back every day -- |
|    ... In rhythm! | (617) 890-2175       | 20 miles, uphill both ways.     |
+-------------------+----------------------+---------------------------------+
|           ...! [ princeton mit-eddie bu sunne ] !polygen!jerry             |
|                            jerry@polygen.com                               |
+----------------------------------------------------------------------------+
Technical Details
Message-ID: <1103@stewart.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!ncar!hsdndev!bu.edu!polygen!jerry
References: <1688@anaxagoras.ils.nwu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!ncar!hsdndev!bu.edu!polygen!jerry
From: jerry@polygen.uucp (Jerry Shekhel)
Newsgroups: comp.windows.ms.programmer
Subject: Re: animation in Windows?
Message-ID: <1103@stewart.UUCP>
Date: 20 May 91 16:16:26 GMT
References: <1688@anaxagoras.ils.nwu.edu>
Reply-To: jerry@stewart.UUCP (Jerry Shekhel)
Organization: Polygen Corporation, Waltham, MA
Lines: 40