Forum | | | | - Seite 1 - |
|  Julian Schmidt | Hey Leute, warum druckt der Quelltext das Array nicht aus? Wie kann ich außerdem den Text eine andere Schriftart geben (Über UseFont geht es leider nicht)?
$H Windows.ph
Def @ChoosePrinter(1) !"COMDLG32.DLL", "PrintDlgA"
Declare DOCINFO#, text$[]
Struct DOCINFO = cbSize&,lpszDocName&,lpszOutput&,lpszDatatype&,fwType&
Dim DOCINFO#, DOCINFO
Declare PRINTDLG#
Struct PRINTDLG = lStructSize&,hWndOwner&,hDevMode&,hDevNames&,hDC&,Flags&,nFromPage%,nToPage%,nMinPage%,nMaxPage%,nCopies%,hInstance&,lCustData&,lpfnPrintHook&,lpfnSetupHook&,lpPrintTemplateName&,lpPrintSetupTemplateName&,hPrintTemplate&,hSetupTemplate&
Dim PRINTDLG#, PRINTDLG
Def &PD_RETURNDC $100
Declare PrintText$, DocName$
DocName$ = "Array Ausdrucken"
With DOCINFO#
.cbSize& = @SizeOf(DOCINFO#)
.lpszDocName& = @Addr(DocName$)
.lpszOutput& = 0
EndWith
With PRINTDLG#
.lStructSize& = @SizeOf(PRINTDLG#)
.hWndOwner& = %hWnd
.hDevMode& = 0
.Flags& = &PD_RETURNDC
.hDevNames& = 0
.hInstance& = %hInstance
.lpfnPrintHook& = 0
.lpfnSetupHook& = 0
.lpPrintTemplateName& = 0
.lpPrintSetupTemplateName& = 0
EndWith
@ChoosePrinter(PRINTDLG#)
PrintText$ ="Beispiel - Print Array"
whileloop 14
text$[&loop]="TestArray" + Str$(&loop)
Endwhile
var y%=140
~StartDoc(PRINTDLG#.hDC&, DOCINFO#)
~StartPage(PRINTDLG#.hDC&)
'UseFont "Times New Roman",26,0,1,0,1
~TextOut(PRINTDLG#.hDC&, 150, 150, @Addr(PrintText$),@Len(PrintText$))'den Text druckt er
'UseFont "Times New Roman",22,0,0,1,0,0
whileloop 14
~TextOut(PRINTDLG#.hDC&, 80, y%, text$[&loop],@Len(text$[&loop]))'das Array druckt er nicht ;(
y%=y%+50
Endwhile
~EndPage(PRINTDLG#.hDC&)
~EndDoc(PRINTDLG#.hDC&)
Dispose DOCINFO#
Dispose PRINTDLG#
LG
Julian57 |
| | | ˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗ Webseite [...]  | 14.06.2011 ▲ |
| |
|  | « Dieser Beitrag wurde als Lösung gekennzeichnet. » | |  Thomas Freier |  Alten Beitrag gelöscht. Zu den Escape Sequenzen suche im Web. Aber die helfen bei den heutigen Druckern wohl auch nicht weiter, denn es geht ja auch so:
$H Windows.ph
Def @ChoosePrinter(1) !"COMDLG32.DLL", "PrintDlgA"
Declare DOCINFO#, text$[]
Struct DOCINFO = cbSize&,lpszDocName&,lpszOutput&,lpszDatatype&,fwType&
Dim DOCINFO#, DOCINFO
Declare PRINTDLG#
Struct PRINTDLG = lStructSize&,hWndOwner&,hDevMode&,hDevNames&,hDC&,Flags&,nFromPage%,nToPage%,nMinPage%,nMaxPage%,nCopies%,hInstance&,lCustData&,lpfnPrintHook&,lpfnSetupHook&,lpPrintTemplateName&,lpPrintSetupTemplateName&,hPrintTemplate&,hSetupTemplate&
Dim PRINTDLG#, PRINTDLG
Def &PD_RETURNDC $100
Declare PrintText$, DocName$
DocName$ = "Array Ausdrucken"
With DOCINFO#
.cbSize& = @SizeOf(DOCINFO#)
.lpszDocName& = @Addr(DocName$)
.lpszOutput& = 0
EndWith
With PRINTDLG#
.lStructSize& = @SizeOf(PRINTDLG#)
.hWndOwner& = %hWnd
.hDevMode& = 0
.Flags& = &PD_RETURNDC
.hDevNames& = 0
.hInstance& = %hInstance
.lpfnPrintHook& = 0
.lpfnSetupHook& = 0
.lpPrintTemplateName& = 0
.lpPrintSetupTemplateName& = 0
EndWith
@ChoosePrinter(PRINTDLG#)
PrintText$ ="Beispiel - Print Array"
whileloop 14
text$[&loop]="TestArray" + Str$(&loop)
Endwhile
~StartDoc(PRINTDLG#.hDC&, DOCINFO#)
~StartPage(PRINTDLG#.hDC&)
'siehe Hilfe "Drucken"
StartPaint PRINTDLG#.hDC&
UseFont "Times New Roman",(24.0*3.7),0,1,0,1
EndPaint PRINTDLG#.hDC&
~TextOut(PRINTDLG#.hDC&, (15*3.7), (15*3.7), @Addr(PrintText$),@Len(PrintText$))
StartPaint PRINTDLG#.hDC&
UseFont "Arial",(16.0*3.7),0,0,0,0,0
EndPaint DC&
declare text$
var y%=50
whileloop 14
Text$=text$[&loop]
~TextOut(PRINTDLG#.hDC&, (15*3.7), (y%*3.7), @Addr(Text$),@Len(Text$))
y%=y%+18
Endwhile
~EndPage(PRINTDLG#.hDC&)
~EndDoc(PRINTDLG#.hDC&)
Dispose DOCINFO#
Dispose PRINTDLG#
Über den Faktor Bildschirmpunkt zum Druckerpunkt wirst du hier auch noch etwas finden. |
| | | | |  |
| |  Thomas Freier | Also drucken ginge schon, wenn du innerhalb der Schleife den gleichen Befehl absetzt.
$H Windows.ph
Def @ChoosePrinter(1) !"COMDLG32.DLL", "PrintDlgA"
Declare DOCINFO#, text$[]
Struct DOCINFO = cbSize&,lpszDocName&,lpszOutput&,lpszDatatype&,fwType&
Dim DOCINFO#, DOCINFO
Declare PRINTDLG#
Struct PRINTDLG = lStructSize&,hWndOwner&,hDevMode&,hDevNames&,hDC&,Flags&,nFromPage%,nToPage%,nMinPage%,nMaxPage%,nCopies%,hInstance&,lCustData&,lpfnPrintHook&,lpfnSetupHook&,lpPrintTemplateName&,lpPrintSetupTemplateName&,hPrintTemplate&,hSetupTemplate&
Dim PRINTDLG#, PRINTDLG
Def &PD_RETURNDC $100
Declare PrintText$, DocName$
DocName$ = "Array Ausdrucken"
With DOCINFO#
.cbSize& = @SizeOf(DOCINFO#)
.lpszDocName& = @Addr(DocName$)
.lpszOutput& = 0
EndWith
With PRINTDLG#
.lStructSize& = @SizeOf(PRINTDLG#)
.hWndOwner& = %hWnd
.hDevMode& = 0
.Flags& = &PD_RETURNDC
.hDevNames& = 0
.hInstance& = %hInstance
.lpfnPrintHook& = 0
.lpfnSetupHook& = 0
.lpPrintTemplateName& = 0
.lpPrintSetupTemplateName& = 0
EndWith
@ChoosePrinter(PRINTDLG#)
PrintText$ ="Beispiel - Print Array"
whileloop 14
text$[&loop]="TestArray" + Str$(&loop)
Endwhile
var y%=140
~StartDoc(PRINTDLG#.hDC&, DOCINFO#)
~StartPage(PRINTDLG#.hDC&)
'UseFont "Times New Roman",26,0,1,0,1
~TextOut(PRINTDLG#.hDC&, 150, 150, @Addr(PrintText$),@Len(PrintText$))'den Text druckt er
'UseFont "Times New Roman",22,0,0,1,0,0
declare text$
y%=300
whileloop 14
Text$=text$[&loop]
~TextOut(PRINTDLG#.hDC&, 150, y%, @Addr(Text$),@Len(Text$))
y%=y%+150
Endwhile
~EndPage(PRINTDLG#.hDC&)
~EndDoc(PRINTDLG#.hDC&)
Dispose DOCINFO#
Dispose PRINTDLG#
Da du nicht zwischen Startprint und Endprint druckst, kann der Font vermutlich nur durch Senden der entsprechenden Escape-Sequenzen umgestellt werden. |
| | | | |
| |  Julian Schmidt | Wie meinst du das mit der Escape-Sequenz? Ein Beispiel? |
| | | ˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗ Webseite [...]  | 14.06.2011 ▲ |
| |
| |  Thomas Freier |  Alten Beitrag gelöscht. Zu den Escape Sequenzen suche im Web. Aber die helfen bei den heutigen Druckern wohl auch nicht weiter, denn es geht ja auch so:
$H Windows.ph
Def @ChoosePrinter(1) !"COMDLG32.DLL", "PrintDlgA"
Declare DOCINFO#, text$[]
Struct DOCINFO = cbSize&,lpszDocName&,lpszOutput&,lpszDatatype&,fwType&
Dim DOCINFO#, DOCINFO
Declare PRINTDLG#
Struct PRINTDLG = lStructSize&,hWndOwner&,hDevMode&,hDevNames&,hDC&,Flags&,nFromPage%,nToPage%,nMinPage%,nMaxPage%,nCopies%,hInstance&,lCustData&,lpfnPrintHook&,lpfnSetupHook&,lpPrintTemplateName&,lpPrintSetupTemplateName&,hPrintTemplate&,hSetupTemplate&
Dim PRINTDLG#, PRINTDLG
Def &PD_RETURNDC $100
Declare PrintText$, DocName$
DocName$ = "Array Ausdrucken"
With DOCINFO#
.cbSize& = @SizeOf(DOCINFO#)
.lpszDocName& = @Addr(DocName$)
.lpszOutput& = 0
EndWith
With PRINTDLG#
.lStructSize& = @SizeOf(PRINTDLG#)
.hWndOwner& = %hWnd
.hDevMode& = 0
.Flags& = &PD_RETURNDC
.hDevNames& = 0
.hInstance& = %hInstance
.lpfnPrintHook& = 0
.lpfnSetupHook& = 0
.lpPrintTemplateName& = 0
.lpPrintSetupTemplateName& = 0
EndWith
@ChoosePrinter(PRINTDLG#)
PrintText$ ="Beispiel - Print Array"
whileloop 14
text$[&loop]="TestArray" + Str$(&loop)
Endwhile
~StartDoc(PRINTDLG#.hDC&, DOCINFO#)
~StartPage(PRINTDLG#.hDC&)
'siehe Hilfe "Drucken"
StartPaint PRINTDLG#.hDC&
UseFont "Times New Roman",(24.0*3.7),0,1,0,1
EndPaint PRINTDLG#.hDC&
~TextOut(PRINTDLG#.hDC&, (15*3.7), (15*3.7), @Addr(PrintText$),@Len(PrintText$))
StartPaint PRINTDLG#.hDC&
UseFont "Arial",(16.0*3.7),0,0,0,0,0
EndPaint DC&
declare text$
var y%=50
whileloop 14
Text$=text$[&loop]
~TextOut(PRINTDLG#.hDC&, (15*3.7), (y%*3.7), @Addr(Text$),@Len(Text$))
y%=y%+18
Endwhile
~EndPage(PRINTDLG#.hDC&)
~EndDoc(PRINTDLG#.hDC&)
Dispose DOCINFO#
Dispose PRINTDLG#
Über den Faktor Bildschirmpunkt zum Druckerpunkt wirst du hier auch noch etwas finden. |
| | | | |
| |  Julian Schmidt | Danke für deine Hilfe, und besonders die guten Beispiele  |
| | | ˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗ Webseite [...]  | 15.06.2011 ▲ |
| |
|
AntwortenThemenoptionen | 7.303 Betrachtungen |
ThemeninformationenDieses Thema hat 2 Teilnehmer: |