Ver Mensaje Individual
  #2  
Antiguo 28-05-2007
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Que tal algo así:

Código Delphi [-]
procedure SaveControlImage(Control: TWinControl; FileName: TFileName);
var
  DC: HDC;
  Bitmap: TBitmap;

begin
  Bitmap := TBitmap.Create;

  try
    Bitmap.Width := Control.Width;
    Bitmap.Height := Control.Height;

    DC := GetWindowDC(Control.Handle);
    BitBlt(Bitmap.Canvas.Handle, 0, 0, Control.Width, Control.Height, DC, 0, 0, SRCCOPY);
    ReleaseDC(Control.Handle, DC);

    Bitmap.SaveToFile(FileName);
  finally
    Bitmap.Free;
  end;
end;

// Saludos
Responder Con Cita