' XPRINT Graphics — GDI drawing on printer DC
#COMPILE EXE
#DIM ALL

DECLARE FUNCTION CreateDC LIB "GDI32.DLL" ALIAS "CreateDCA" (BYVAL lpDriverName AS ASCIIZ, BYVAL lpDeviceName AS ASCIIZ, BYVAL lpOutput AS ASCIIZ, BYVAL lpInitData AS LONG) AS LONG
DECLARE FUNCTION DeleteDC LIB "GDI32.DLL" (BYVAL hDC AS LONG) AS LONG
DECLARE FUNCTION TextOut LIB "GDI32.DLL" ALIAS "TextOutA" (BYVAL hDC AS LONG, BYVAL x AS LONG, BYVAL y AS LONG, BYVAL lpString AS ASCIIZ, BYVAL nCount AS LONG) AS LONG
DECLARE FUNCTION MoveToEx LIB "GDI32.DLL" (BYVAL hDC AS LONG, BYVAL x AS LONG, BYVAL y AS LONG, BYVAL lpPoint AS LONG) AS LONG
DECLARE FUNCTION LineTo LIB "GDI32.DLL" (BYVAL hDC AS LONG, BYVAL x AS LONG, BYVAL y AS LONG) AS LONG
DECLARE FUNCTION Rectangle LIB "GDI32.DLL" (BYVAL hDC AS LONG, BYVAL left AS LONG, BYVAL top AS LONG, BYVAL right AS LONG, BYVAL bottom AS LONG) AS LONG
DECLARE FUNCTION Ellipse LIB "GDI32.DLL" (BYVAL hDC AS LONG, BYVAL left AS LONG, BYVAL top AS LONG, BYVAL right AS LONG, BYVAL bottom AS LONG) AS LONG

FUNCTION PBMAIN() AS LONG
    PRINT "XPRINT Graphics via GDI:"
    PRINT "- TextOut for text on printer"
    PRINT "- Rectangle for boxes"
    PRINT "- Ellipse for circles"
    PRINT "- MoveToEx/LineTo for lines"
    PRINT "Combine with StartDoc/StartPage/EndPage"
    FUNCTION = 0
END FUNCTION
