delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/17/20:52:11

Date: Wed, 17 Sep 1997 19:53:29 -0500 (CDT)
From: Andrew Deren <aderen AT eecs DOT uic DOT edu>
To: "Gautam N. Lad" <gautam AT interlog DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: BITMAP in Allegro
In-Reply-To: <5vfeda$fa9$1@news.interlog.com>
Message-ID: <Pine.SUN.3.95.970917194644.8352A-100000@bert.eecs.uic.edu>
MIME-Version: 1.0

On Sun, 14 Sep 1997, Gautam N. Lad wrote:

> Hi,
> I don't know if this is already in Allegro's DOC, but here goes.
> I want to write something onto 'screen', but before I do, I want to
> save the portion of the screen that will be overwritten.  
> What I mean is, I've created my own GUI routines, and when a dialog box is 
> activated, I want to save only the area of the screen the dialog covers.  Once the 
> dialog box goes away, I want to put the original portion back.
> 
> How do I do this, without getting the entire screen, and doing a double buffer.
> I only want to do a portion double buffer.  Does this have anything to do with 
> sub bitmaps?

Just create a bitmap and blit into it, here is a short example:
let w and h be dimensions of the dialog and x and y the location of it

temp_bmp = create_bitmap(w, h);
blit(screen, temp_bmp, x, y, 0, 0, w, h);
do the dialog
blit(temp_bmp, screen, 0, 0, x, y, w, h);
destroy_bitmap(temp_bmp);

I think you are going to have to add 1 or subtract one somewhere, but
don't remember where and whether you do have to.

> 
> Any suggestions!?!?
> Bye!
> 
> ****************************************************
> * Gautam N. Lad                                    *
> *--------------------------------------------------*
> *                                                  *
> * E-Mail    : gautam AT interlog DOT com                  *
> * Website   : http://www.interlog.com/~gautam      *
> *                                                  *
> * OS/2, DOS/Windows, Graphics Gallery, Software,   *
> * Links, Rayzor Editor/2, POV-Ray, TexturEyes,     *
> * POV-PAK and lots lots lots more!!!!!!!           *
> ****************************************************
> 


                        ,,,
                       (0 0)
   +-------------oOO----(_)-------------------+
   |                Andrew Deren              |  
   |             aderen AT eecs DOT uic DOT edu          |
   | www.eecs.uic.edu/~aderen/ader/main.html  |
   +-------------------------oOO--------------+
                       || ||
                      ooO Ooo
 


- Raw text -


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