I -think- what you're talking about is masking.

You need -three- bitmaps: the screen image, the
new image, and the mask.  If I remember right, it
should go something like this:

        screen[idx] = (screen[index] & mask[index]) | (image[index] &
~mask[index]);

Now bear in mind two things: one, the above
is recreated from scratch -- I might have gotten
the logic wrong (but the concept should work,
even if the equation is wrong); two: I am unfamiliar 
w/ the  greyscale memory image format in the pilot.  
I am assuming a "packed" bitmap, where N adjascent
bits are taken as the value for a single pixel.
If the darned thing works w/ bitplanes, you've
got slightly different math ahead of you.

        Screen:         01010101
        Mask:                   11001100
        Image:          10101010

        Screen&Mask             01000100
        image&~mask             00100010

        or the above    01100110
                                ^^||^^||

        (|| new, ^^ original)



-- 
-Richard M. Hartman
[EMAIL PROTECTED]

186,000 mi./sec ... not just a good idea, it's the LAW!


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 08, 1999 11:01 PM
> To: [EMAIL PROTECTED]
> Subject: window/bitmap bits
> 
> 
> I am looking for some source code which manipulates pixels 
> within a bitmap
> or window, preferably greyscale images manipulating either or 
> both planes.
> 
> My ultimate goal is to quantize a greyscale image down to 
> black and white,
> scrANDNOT it off the screen, then scrOR the original 
> greyscale image back
> onto the screen.
> 
> The way it stands now, if you scrOR a light grey pixel onto a 
> dark grey
> pixel, the pixel becomes black on the screen. Icky! I want the pixels
> copied onto the screen to take precedence as to what is already there.
> 
> 

Reply via email to