From: "Steve Schafer (TeamB)" Subject: Re: How to apply the Windows Shutdown Screen Effect to a bitmap ? Date: 24 Mar 2000 00:00:00 GMT Message-ID: <8ionds47bqv3bl0tsmtssvrdqp3vphcjqg@4ax.com> Content-Transfer-Encoding: 7bit References: <8bgkbp$a0u6@bornews.borland.com> Content-Type: text/plain; charset=us-ascii Organization: TeamB Mime-Version: 1.0 Reply-To: pandeng@telepath.com Newsgroups: borland.public.delphi.graphics On Fri, 24 Mar 2000 12:58:16 -0800, "Monte Etherton" wrote: >I am a novice in graphics, but I would like to apply this "screening" effect >to a bitmap. I have tried PatBlt, DrawState, and BitBlt, but I don't know >what combination of params I need. > >I can affect the bitmap, but not the way I want. If any one has some sample >code, I would appreciate it. 1) Create an 8x8 bitmap, where the pixels alternate black and white (as in a checkerboard). 2) Load that bitmap into the Brush.Bitmap property of whatever Canvas it is that you're trying to modify. 3) Set the canvas's CopyMode to $00A000C9. (This ANDs the destination with the pattern.) 4) Use CopyRect to draw the canvas onto itself. Here's a simple example: var Bmp: TBitmap; begin Bmp := TBitmap.Create; Bmp.LoadFromFile('brush.bmp'); with Image1.Picture.Bitmap do begin Canvas.Brush.Bitmap := Bmp; Canvas.CopyMode := $00A000C9; Canvas.CopyRect(Rect(0, 0, Width, Height), Canvas, Rect(0, 0, 0, 0)) end; Bmp.Free end; -Steve