graphicbox #w.gb, 400, 0, 1, 1
open "High quality printing" for graphics_nsb as #w
#w.gb "horizscrollbar on 0 2400"
#w.gb "font Arial 0 120"
#w.gb "\\\ This should be printed in really high quality!"
#w.gb "print 2400"
wait
open "Line endcap" for graphics_nsb as #w
thickness = 12
#w "down; size ";thickness
#w "line 50 100 250 150"
hw = hwnd(#w)
calldll #user32, "GetDC", hw as ulong, hdc as ulong
struct logbrush, lbStyle as ulong, lbColor as ulong, lbHatch as ulong
penstyle = _PS_GEOMETRIC or _PS_ENDCAP_FLAT
calldll #gdi32, "ExtCreatePen", penstyle as long, thickness as long, _
logbrush as struct, 0 as long, 0 as long, pen as ulong
calldll #gdi32, "SelectObject", hdc as ulong, pen as ulong, old as ulong
#w "line 50 200 250 250"
calldll #gdi32, "SelectObject", hdc as ulong, old as ulong, pen as ulong
calldll #gdi32, "DeleteObject", pen as ulong, ret as void
wait