gfx merging

 BBS: Inland Empire Archive
Date: 03-05-93 (15:45)             Number: 264
From: MIKE HEBERT                  Refer#: NONE
  To: CALVIN FRENCH                 Recvd: NO  
Subj: gfx merging                    Conf: (2) Quik_Bas
Hmmm..  I saw the message you left concerning graphics
merging, and I think I can help.   What I'm assuming you
mean by graphics merging is put an image over another image
without disturbing the first image.  What you have to do
(if you're using 256 colors) is:

Draw the picture you want to put over the backgorund.

Take an area of screen the same size and change everything
that is black in the original picture to color 255 in the
new picture, and change everything else to black.

GET both of the pictures (making sure they're EXACTLY the same size).

Display the background, and GET the area that will be
covered by the image (just so you can restore it later).

PUT the 2nd image (the one with only colors 0 and 255) using AND

PUT the 1st image in EXACTLY the same spot using XOR

... And Voila!  You have just put an image over a
background without destroying the background the way PSET
does !

For 16 color mode, use color 15 instead of 255 for the 2nd image.

Of course, there is a problem with using this without page
flipping...  The background turns black for a split second
before it appears...  But I'm working on a Page Flipping
technique for QB in screen mode 13...  I've done some test
runs with it, and it goes about as fast as Autodesk
Animator..  But that isn't quite fast enough ...  If I ever
do get it working fast enough, I MIGHT, just MIGHT release
the source code (but then again, I could probably make a
few bucks off it.)

I hope I've helped you a little . . . :)


--- Maximus/2 2.01wb
 * Origin: TeeWunKay (1:140/37)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET