Ver Mensaje Individual
  #1  
Antiguo 30-06-2006
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Reputación: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Girar un texto o imagen para imprimirlo

Como girar un texto o imagen para imprimirlo

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
   LogRec: TLOGFONT;
   OldFont,NewFont: HFONT;
   i, X, Y: LongInt;

begin
  if pdPrinter.Execute then begin
    with Printer do begin
      GetObject(Canvas.Font.Handle, SizeOf(LogRec), @LogRec);
      BeginDoc;
      for i := 0 to 5 do begin
        LogRec.lfEscapement := (i * 60)*10;
        LogRec.lfOutPrecision := OUT_TT_ONLY_PRECIS;
        LogRec.lfFaceName := 'Times New Roman';
        NewFont := CreateFontIndirect(LogRec);
        OldFont := SelectObject(Canvas.Handle,NewFont);
        Canvas.TextOut(100, 100, 'Hello World!');
        NewFont := SelectObject(Canvas.Font.Handle,OldFont);
        DeleteObject(NewFont);
      end; { for }
      EndDoc;
    end;
  end;
end.
Responder Con Cita