🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.msdos.programmer
2 messages
2 total messages Started by Brad Hlista Mon, 27 Nov 1989 18:46
graphic stencils
#414
Author: Brad Hlista
Date: Mon, 27 Nov 1989 18:46
9 lines
921 bytes
For those familiar with TurboC graphics, is there an easy way to place
images into graphics memory so that they will behave as stencils when 
many colors are being used.  If not, can I do something with the latch
registers that will preserve colors when shapes are written over existing
shapes...or do I need to go ahead and write new code to do stencils?
I ran into this problem recently and have not thought about it much...
hopefully, someone has a quick hack to do this.  Thanks for any help.

elrond@titan.tsd.arlut.utexas.edu
Re: graphic stencils
#415
Author: Charles Hannum
Date: Tue, 28 Nov 1989 02:29
25 lines
1537 bytes
The easiest way I can think of to do this is the following:

Create a negative of the image in black-and-white.  Basically, the area that
you want to block out (to be overwritten by the actual image) should be black,
while the rest of the pattern should be white.  This pattern should be the
same size as the actual image.

Then, simply AND this with the background using putimage(), then OR the image
itself onto the screen, again using putimage().  The OR and AND functions are
a parameter to putimage().  I can't remember the format right off hand, but
you can look it up.

This method is used quite often in animation.  Its main feature is that it can
handle multiple colors.

If you using only a two-color system, of course, you can just OR the image on
to the screen.

If you need more help, I can email a sample program.

--
- Charles Martin Hannum II       "Klein bottle for sale ... inquire within."
    (That's Charles to you!)     "To life immortal!"
  cmh117@psuvm.{bitnet,psu.edu}  "No noozzzz izzz netzzzsnoozzzzz..."
  c9h@psuecl.{bitnet,psu.edu}    "Mem'ry, all alone in the moonlight ..."
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads