PBXB64 Graphics & GUI
Graphics & GUI Standard
Full graphics and GUI support with GRAPHIC WINDOW, LINE, BOX, CIRCLE, COLOR, FONT, PRINT, and GUI NEW / MESSAGE LOOP. Create windows, draw primitives, handle events, and build complete Win32 GUI applications. All backed by real GDI/GDI+ calls.
GRAPHIC WINDOW - Drawing Surface
Graphic window with primitives
#COMPILE EXE
#DIM ALL
FUNCTION PBMAIN() AS LONG
LOCAL hWin AS QUAD
GRAPHIC WINDOW "My Drawing", 100, 100, 640, 480 TO hWin
GRAPHIC COLOR RGB(255, 0, 0), RGB(0, 0, 0) ' foreground, background
GRAPHIC LINE (50, 50) - (200, 150)
GRAPHIC BOX (220, 50) - (320, 150) ' outline only
GRAPHIC BOX (340, 50) - (440, 150), 0, RGB(0, 255, 0), RGB(0, 0, 255) ' corner, edge, fill
GRAPHIC CIRCLE (500, 100), 50, RGB(255, 255, 0) ' centre, radius, edge color
GRAPHIC FONT "Arial", 16, 0
GRAPHIC PRINT "Hello Graphics!"
SLEEP 3000
GRAPHIC CLOSE
FUNCTION = 0
END FUNCTIONGRAPHIC WINDOW ... TO hWin creates a drawing surface and returns its handle. LINE, BOX (filled/outlined), CIRCLE, COLOR (foreground/background, built with RGB()), FONT, and PRINT all work with real GDI calls. GRAPHIC CLOSE releases resources.
GUI NEW - Win32 Window
GUI window with message loop
#COMPILE EXE
#DIM ALL
FUNCTION PBMAIN() AS LONG
LOCAL hWnd AS QUAD
GUI NEW "MyWindow", 100, 100, 400, 300 TO hWnd
' Message loop: returns when the window is closed
GUI MESSAGE LOOP
FUNCTION = 0
END FUNCTIONGUI NEW ... TO hWnd creates a real Win32 window with class registration and WndProc. GUI MESSAGE LOOP runs the standard GetMessage/DispatchMessage loop and returns when the window is closed. All Win32 messages are processed correctly.