Mega Code Archive

 
Categories / Delphi / Graphic
 

Grabcapture each controlobject with ease

Title: grab/capture each control/object with ease Question: How can I grab a visible object (as a bitmap) with only a few lines of code? Answer: It is as easy as this: procedure ............ var DC: HDC; begin //have image1`as big as the the control to be grabbed // here as big as DBCtrlGrid1 which will be grabbed DC := GetDC (DBCtrlGrid1.Handle); try BitBlt(image1.Canvas.Handle, 0, 0, image1.Width,image1.Height, DC, 0, 0, SRCCOPY); ImageEnView1.Repaint; finally ReleaseDC(DBCtrlGrid1.Handle,DC); end; ............ end; mer Yasar Can omercan@home.nl