From: Renate Schaaf Subject: Re: BitBlt Question - here is code Date: 06 Feb 2000 00:00:00 GMT Message-ID: Content-Transfer-Encoding: 8bit References: <87d5so$4tb3@bornews.borland.com> <87fk3p$5rd5@bornews.borland.com> <87j6r8$6st4@bornews.borland.com> Content-Type: text/plain; charset=iso-8859-1 Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Reply-To: renates@xmission.com Newsgroups: borland.public.delphi.graphics Afterthought: Why not let windows do the updating? It knows how to paint the original form, anyways. Remembering a tip by Robert Rossmair from last week, I tried the following, and it works (This way you don't need the OldBG bitmap at all anymore): procedure TForm1.RestoreBG(NewX, NewY: Integer); var DC: HDC; R:TRect; begin DC := Self.Handle; if NewY > OffsetY then begin R:=Rect(OffsetX, OffSetY, OffsetX+SourceW, NewY); InvalidateRect(DC, @R,True); end; if NewY < OffsetY then begin R:=Rect(OffsetX, NewY + SourceH, OffsetX+SourceW, OffsetY+SourceH); InvalidateRect(DC, @R,True); end; if NewX > OffsetX then begin R:=Rect(OffsetX, OffsetY, NewX, OffsetY+SourceH); InvalidateRect(DC, @R,True); end; if NewX < OffsetX then begin R:=Rect(NewX + SourceW, OffsetY, OffsetX+SourceW, OffsetY+SourceH); InvalidateRect(DC, @R,True); end; end; Renate