Autor Beitrag
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: So 01.05.05 11:29 
Nein Leider nicht, aber hier nocheinmal der richtige Text:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
 printer.orientation:=polandscape;
 with Printer do begin
      BeginDoc;
      Canvas.Draw((PageWidth - bmp.Width) div 2, (PageHeight - bmp.Height) div 2, bmp);
      EndDoc;
     end;
     bmp.Free;
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Di 03.05.05 18:21 
Hallo!
Ich habe jetzt eine Methode gefunden um mein Formular auszudrucken:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
bmp:=tbitmap.create;
 bmp:=Tgraph.GetFormImage;

 //printer.Orientation:=polandscape;



  with Printer do
  begin
    BeginDoc;
    // Mit BeginDoc wird ein Druckauftrag initiiert.
    // The StartDoc function starts a print job.
    try
      ScaleX := GetDeviceCaps(Handle, logPixelsX) div PixelsPerInch;
      ScaleY := GetDeviceCaps(Handle, logPixelsY) div PixelsPerInch;
      // Informationen über die Auflösung
      // Retrieves information about the Pixels per Inch of the Printer.
      RR := Rect(00, bmp.Width*Scalex-900, bmp.Height*scaley-900);
            Canvas.StretchDraw(RR, bmp);
      // An die Auflösung anpassen
      // Stretch to fit

    finally
      EndDoc;   //Methode EndDoc beendet den aktuellen Druckauftrag und schließt die
      // Textdatei-Variable.
      // Steht in finally - um auch bei Abbruch des Druckauftrages Papierausgabe
      // sicherzustellen
    end;
  end;

Mann kann auch schön die Ränder einstellen, doch ein Problem gibt es noch:
Um das Bitmap ist ein Rahmen, den ich auch gerne haben wollte, doch leider druckt mir der Drucker nur die Linien oberhalb und rechts des Bitmaps aus. Unten und rechts fehlen sie einfach!
Hat einer ne Idee :?:
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Di 03.05.05 20:35 
Da hat mir aber die Bild und Fax Anzeige von Microsoft einen Streich gespielt. Das sah immer so aus, als ob da immer ein kompletter Rahmen sei. Aber nun hat sich das Problem nur verlegt. Kann ich bei dem Screenshot des Formular irgendwie den ganzen Rahmen mitkriegen?
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Mi 04.05.05 17:00 
Das dürfte schwieriger sein, denn dann müsstes du ein Screenshot machen. Ich kenne zu mindestens keine andere Variante. Und du musst dafür sorgen, dass dein Formular, von dem der Srennshot gemacht werden soll, kurz im Vordergrund liegt.
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Mo 09.05.05 13:36 
user profile iconHeiko hat folgendes geschrieben:
Das dürfte schwieriger sein, denn dann müsstes du ein Screenshot machen. Ich kenne zu mindestens keine andere Variante. Und du musst dafür sorgen, dass dein Formular, von dem der Srennshot gemacht werden soll, kurz im Vordergrund liegt.


Also heißt das. dass es dafür keine wirklich gute Lösung gibt?
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Mo 09.05.05 17:00 
Das es keine gibt will ich nicht sagen. Es heißt nur das ich keine bessere Variante dafür kenne.
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Mo 09.05.05 20:39 
Gibt es vieleicht die Möglichkeit garkeinen Rahmen mit zu nehmen, und danach hinterher mit Canvas einen drum zu zeichnen?
Ich sehe nur leider keine Möglichkeit keinen Rahmen zu nehmen :P
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Di 10.05.05 06:46 
Ohne dem Fensterrand bekommst du das FormulatBild mit GetFormImage. Das speicherst du iin einem Bitmap ab und kannst es dann mit Canvas beliebig bearbeiten.
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Di 10.05.05 10:05 
Ich mache ja bereits ein Bitmap mit getformimage, da sind ja aber diese nicht vollständigen Ränder. Vieleicht reden wir aneinander vorbei, deswegen hier ein Bild:

www.waltrop.dlrg.de/T.bmp

Diese Ränder stören mich. :D
Danke :wink:
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Di 10.05.05 15:17 
Aso die sinfd immer da bei dem Befehl bei dir da. Bei D6 ist das nicht. Wie groß war dein Formularfenster bei diesem Bild (ClientWidt, ClientHeight)? Wenn du es nicht mehr weißt mach das Bild nochmal und schreib mal die Fensterbreite/-höhe und die Größe von Bild. Bild brauchst du nicht nocheinmal reinstellen.
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Di 10.05.05 17:11 
Ich habe das ganze mal mit sowohl leeren Formularen, als auch mit gefüllten Formularen getestet, und auch noch mit anderen größen, doch es sind immer Ränder da! :twisted:
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Di 10.05.05 18:39 
Und stimmen die Maße überein? Also ClienWidth=Bild_Breite und ClientHeight=Bild_Höhe.
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Di 10.05.05 20:16 
Also ich habe hier mal die Zahlen:

Formular: 1280 x 1005
Bild: 1280 x 1005 :D
8) Klar-Ist beides das Gleiche
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Mi 11.05.05 16:00 
Das sagt einiges aus. Es müsste ganz rechts und unte beim Formular eine Pixelreihe je Fehlen, da ja ein schwarze Reihe oben mehr ist. Kannst du das mal Überprüfen ob wirklich die Pixelreihehn nicht kopiert werden oder ob nur die obere und rechte Pixelreihe nur schwarz gespeichert wird?
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Mi 11.05.05 17:15 
Eine vielicht es dumme Frage :wink: aber wie kann ich das machen :wink:
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Mi 11.05.05 17:35 
Leg einfach einen Button direkt an den unteren und linken Rand, so dass kein Pixel abstand mehr zum Rand des Fensters ist. Der Rand eines Buttons ist normlaerweise 2 Pixel breit. Es müsste ein Pixel rechts oder unten fehelen.
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Mi 11.05.05 18:10 
Ne.. Der Button ist komplett sichtbar. Ich habe sowieso ein Label direkt unten rechts, und davon wird auch nichts abgeschnitten.
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Mi 11.05.05 18:53 
Naja beim Label gibt es ja einen "transparenten" Bereich wo es nicht auffallen würde wenn etwas fehlt. Ich mache mal morgen ein Progr. wo du mir mal den Screenshot gibst.
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Fr 13.05.05 15:27 
Hy, Klasse :o Vielen Dank Heiko!
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: So 15.05.05 10:12 
Also ich breche das dann mal ab. Wenn das mit neueren Versionen gehen soll. Ich wollte mir jetzt auch Delphi 2005 kaufen.