|
Const PT_LINETO = &H2
Const PT_BEZIERTO = &H4
Const PT_CLOSEFIGURE = &H1
Const DI_APPBANDING = &H1
Const DI_ROPS_READ_DESTINATION = &H2
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type DOCINFO
cbSize As Long
lpszDocName As String
lpszOutput As String
lpszDatatype As String
fwType As Long
End Type
Private Declare Function PolyDraw Lib "gdi32" (ByVal hdc As Long, lppt As POINTAPI, lpbTypes As Byte, ByVal cCount As Long) As Long
Private Declare Function StartDoc Lib "gdi32" Alias "StartDocA" (ByVal hdc As Long, lpdi As DOCINFO) As Long
Private Declare Function StartPage Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function EndPage Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function EndDoc Lib "gdi32" (ByVal hdc As Long) As Long
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim Pt(1 To 2) As POINTAPI, bTypes(1 To 2) As Byte, DI As DOCINFO
'fill the DOCINFO-structure
DI.cbSize = Len(DI)
DI.lpszDocName = "API-Guide Code Demonstration"
DI.lpszOutput = vbNullString
DI.lpszDatatype = vbNullString
'starts a print job
Call StartDoc(Printer.hdc, DI)
'prepare the printer driver to accept data
Call StartPage(Printer.hdc)
Pt(2).x = 50
Pt(2).y = 30
bTypes(1) = PT_LINETO
bTypes(2) = PT_LINETO
'draw a set of line segments
PolyDraw Printer.hdc, Pt(1), bTypes(1), 2
'inform the device that the application has finished writing to a page
Call EndPage(Printer.hdc)
'end the print job
Call EndDoc(Printer.hdc)
End Sub
|
|