Einzelnen Beitrag anzeigen

Benutzerbild von PhilmacFLy
PhilmacFLy

Registriert seit: 20. Jan 2008
Ort: Nürnberg
340 Beiträge
 
FreePascal / Lazarus
 
#3

AW: Pixel zu Height bei Drucker Problem

  Alt 8. Mär 2011, 13:06
ich weiss das da noch was um drucken ausenrum fehlt beigndoc und soweiter, aber hier der ganze code:

Delphi-Quellcode:
procedure TAuswertung.Btn_PrintClick(Sender: TObject);
var
  blau, grau, hidunkel, hihell, balken, himessung, praxis: Tcolor;
  P1, P2, P3: TPoint;
  Dreieck: Array[0..2] of TPoint;
  balkenrect: Trect;
  i, akty: Integer;
begin
  i := 0;
  blau := RGB2TColor(0,89,156);
  grau := RGB2TColor(75,75,77);
  praxis := RGB2TColor(123,124,126);
  balken := RGB2TColor(188,189,190);
  himessung := RGB2TColor(240,241,241);
  hidunkel := RGB2TColor(217,218,219);
  hihell := RGB2TColor(240,241,241);

  PrintDialog1.MaxPage:=1;

  PrintDialog1.FromPage:=1;
  PrintDialog1.ToPage:= 1;
  PrintDialog1.Options:=[];
  if
  PrintDialog1.Execute
  then
  begin
    Printer.Title := 'Physiofeedback Messauswertung';
    Printer.BeginDoc;
    SetMapMode(Printer.Canvas.Handle, MM_LOMETRIC);
// Printer.Canvas.Font:=Lbl_Name1.Font;
// Printer.Canvas.Font.Height := 40;
    with Printer.Canvas do
    begin
      Font.Style := [fsbold];
      Font.Name := 'Arial';
      Font.Height := 50;
      Pen.Color := blau;
      Brush.Color:=blau;

      P1.X := 220;
      P1.Y := -450;
      P2.X := 220;
      P2.Y := -480;
      P3.X := 250;
      P3.Y := -465;
      Dreieck[0] := P1;
      Dreieck[1] := P2;
      Dreieck[2] := P3;
      Polygon(Dreieck);
      FloodFill(230, -465, blau, fsborder);

      Font.Color := blau;
      Brush.Color := clwhite;
      TextOut(260, -440, 'Physiofeedback Messauswertung');
      Font.Height := 40;
      TextOut(260, -500, 'Name: ' + frm_messung.lb_kunde.Caption);

      //Messbildschirm
      Pen.Color := balken;
      Brush.Color := balken;
      balkenrect := Rect(220, -570, 1960, -620);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      Font.Height := 30;
      Textout(270,
      Pen.Color := blau;
      Brush.Color := blau;
      P1.X := 240;
      P1.Y := -580;
      P2.X := 240;
      P2.Y := -610;
      P3.X := 255;
      P3.Y := -595;
      Dreieck[0] := P1;
      Dreieck[1] := P2;
      Dreieck[2] := P3;
      Polygon(Dreieck);
      FloodFill(245, -595, blau, fsborder);
      Pen.Color := himessung;
      Brush.Color := himessung;
      balkenrect := Rect(220, -630, 1960, -1350);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      frm_messung.ch_messung.PrintPartial(Rect(Point(640, 1544), Point(4540,3090)));

      //Messeinstelungen
      Pen.Color := balken;
      Brush.Color := balken;
      balkenrect := Rect(220, -1380, 1960, -1430);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      Pen.Color := blau;
      Brush.Color := blau;
      P1.X := 240;
      P1.Y := -1390;
      P2.X := 240;
      P2.Y := -1420;
      P3.X := 255;
      P3.Y := -1405;
      Dreieck[0] := P1;
      Dreieck[1] := P2;
      Dreieck[2] := P3;
      Polygon(Dreieck);
      FloodFill(245, -1405, blau, fsborder);
      Pen.Color := hidunkel;
      Brush.Color := hidunkel;
      balkenrect := Rect(220, -1440, 550, -1680);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      Pen.Color := hihell;
      Brush.Color := hihell;
      balkenrect := Rect(560, -1440, 1270, -1680);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      balkenrect := Rect(1280, -1440, 1960, -1680);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      Pen.Color := balken;
      Pen.Width := 3;
      i := 0;
      akty := -1505;
      while i < 3 do
      begin
        MoveTo(240, akty);
        LineTo(535, akty);
        MoveTo(580, akty);
        LineTo(1240, akty);
        MoveTo(1290, akty);
        LineTo(1950, akty);
        inc(i);
        akty := akty -60;
      end;

      //Messergebnise
      Pen.Color := balken;
      Brush.Color := balken;
      balkenrect := Rect(220, -1700, 1960, -1750);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      Pen.Color := blau;
      Brush.Color := blau;
      P1.X := 240;
      P1.Y := -1710;
      P2.X := 240;
      P2.Y := -1740;
      P3.X := 255;
      P3.Y := -1725;
      Dreieck[0] := P1;
      Dreieck[1] := P2;
      Dreieck[2] := P3;
      Polygon(Dreieck);
      FloodFill(245, -1725, blau, fsborder);
      Pen.Color := hidunkel;
      Brush.Color := hidunkel;
      balkenrect := Rect(220, -1760, 550, -2330);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      Pen.Color := hihell;
      Brush.Color := hihell;
      balkenrect := Rect(560, -1760, 1270, -2330);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      balkenrect := Rect(1280, -1760, 1960, -2330);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      Pen.Color := balken;
      Pen.Width := 3;
      i := 0;
      akty := -1810;
      while i < 7 do
      begin
        MoveTo(240, akty);
        LineTo(535, akty);
        MoveTo(580, akty);
        LineTo(1240, akty);
        MoveTo(1290, akty);
        LineTo(1950, akty);
        inc(i);
        akty := akty -60;
      end;

      //Legende
      Pen.Color := balken;
      Brush.Color := balken;
      balkenrect := Rect(220, -2380, 1960, -2430);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      Pen.Color := blau;
      Brush.Color := blau;
      P1.X := 240;
      P1.Y := -2390;
      P2.X := 240;
      P2.Y := -2420;
      P3.X := 255;
      P3.Y := -2405;
      Dreieck[0] := P1;
      Dreieck[1] := P2;
      Dreieck[2] := P3;
      Polygon(Dreieck);
      FloodFill(245, -2405, blau, fsborder);
      Pen.Color := hihell;
      Brush.Color := hihell;
      balkenrect := Rect(220, -2440, 1960, -2490);
      Rectangle(balkenrect);
      FillRect(balkenrect);

      //Notizen
      Pen.Color := balken;
      Brush.Color := balken;
      balkenrect := Rect(220, -2540, 1960, -2590);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      Pen.Color := blau;
      Brush.Color := blau;
      P1.X := 240;
      P1.Y := -2550;
      P2.X := 240;
      P2.Y := -2580;
      P3.X := 255;
      P3.Y := -2565;
      Dreieck[0] := P1;
      Dreieck[1] := P2;
      Dreieck[2] := P3;
      Polygon(Dreieck);
      FloodFill(245, -2565, blau, fsborder);
      Pen.Color := hihell;
      Brush.Color := hihell;
      balkenrect := Rect(220, -2600, 1960, -2820);
      Rectangle(balkenrect);
      FillRect(balkenrect);
      P1.X := 240;
      P1.Y := -2550;
      P2.X := 240;
      P2.Y := -2580;
      P3.X := 255;
      P3.Y := -2565;
      Dreieck[0] := P1;
      Dreieck[1] := P2;
      Dreieck[2] := P3;
      Polygon(Dreieck);
      FloodFill(245, -2565, blau, fsborder);

    end;
    Printer.EndDoc;
  end

end;
ich habs auch mit size probiert, das gleiche ergebniss
Philipp N.
"Programmiern ist wie küssen:
Mann kan darüber reden, mann kann es beschreiben,
aber man weiss erst, was es bedeutet,
wenn man es getan hat"
  Mit Zitat antworten Zitat