Ver Mensaje Individual
  #2  
Antiguo 04-06-2012
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola ingabraham.

Proba de este modo:
Código Delphi [-]
uses Printers;

procedure PrintControl(aPrn: TPrinter; aWinControl: TWinControl; const aPosX, aPosY: Integer);
var
  Bmp: TBitmap;
  hdcSrc: HDC;
begin
  Bmp:= TBitmap.Create;
  try
    Bmp.Width:= aWinControl.Width;
    Bmp.Height:= aWinControl.Height;
    hdcSrc:= GetWindowDC(aWinControl.Handle);
    try
      BitBlt(Bmp.Canvas.handle, 0, 0, Bmp.Width, Bmp.Height, hdcSrc, 0, 0, SRCCOPY)
    finally
      ReleaseDC(aWinControl.Handle, hdcSrc)
    end;
    aPrn.Canvas.Draw(aPosX, aPosY, Bmp);
  finally
    Bmp.Free
  end
end;

Llamada ejemplo:
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
  Printer: TPrinter;
begin
  Printer:= TPrinter.Create;
  try
    Printer.BeginDoc;
    //...
    PrintControl(Printer, GroupBox1, 100, 50);
    //... 
    Printer.EndDoc;
  finally
    Printer.Free;
  end;
end;

Saludos.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....