From: "Harm" Subject: Re: using bitblt function Date: 23 Jul 2000 00:00:00 GMT Message-ID: <8lf6lt$6pt2@bornews.borland.com> References: <397acd8b_2@dnews> X-Priority: 3 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.delphi.graphics Something like this? procedure FillAndBlitRect(bmp: TBitmap; w,h: integer; pClr,bClr: TColor;xpos,ypos: integer;ToDC: hDC); begin bmp.Width := w; bmp.Height := h; bmp.Canvas.Pen.Color := pClr; bmp.Canvas.Brush.Color := bClr; bmp.Canvas.Rectangle(0,0,w,h); BitBlt(ToDC,xpos,ypos,w,h,bmp.Canvas.Handle, 0,0,SRCCOPY); end; procedure TForm1.Button1Click(Sender: TObject); var b : TBitmap; begin b := TBitmap.Create; FillAndBlitRect(b,128,128,clBlack,clRed,60,60,Form1.Canvas.Handle); b.Free; end; -- Harm http://www.users.uswest.net/~sharman1/ Cool Graphics, for free! "Ran Kornfeld" wrote in message news:397acd8b_2@dnews... > Hello > I am trying to do Double buffering by creating a memory DC and painting a > filled rectangle to it , and then using bitblt, copy it to the window's DC. > It doesn't worked for me, I think the problem was in painting to the memory > DC. > Has someone done it and can give me some sample code?? > > Thanks > Ran