简单的画个思维导图改自exdui

易语言 2020-08-14 10:59:59

简单的画个思维导图改自exdui

zEngineInit (#GF_DPI_ENABLE, 0)
hWnd = zWndCreate (0, 0, 0, 0, 0, 0, 0, 600, 400)
pWnd = zWndBind (hWnd, 位或 (#WS_SHADOW, #WS_ESCEXIT, #WS_MOVEABLE, #WS_MAINWINDOW, #WS_TOPMOST), 18, 0, 0)
.如果真 (pWnd ≠ 0)
zObjRegister (#TYPE_MIND, #OS_VISIBLE, 0, 0, 0, 0, 到整数 (&zObjDefproc))
思维导图Z.创建 (pWnd, 20, 20, 560, 360)
zWndSetShadow (pWnd, #紫色, 5)
zWndShow (pWnd)
zWndLoop ()
.如果真结束
zEngineUninit ()
返回 (0) ' 可以根据您的需要返回任意数值

.子程序 zWndBind, 整数型, 公开, ret pWnd
.参数 hWnd, 整数型, ,
.参数 dwStyle, 整数型, ,
.参数 dwPos, 整数型, , 0:默认 1:左 2:水平中 4:右 8:上 16:水平中 32:下
.参数 lpfnMsgProc, 整数型, , (int)cbk(hWnd,pWnd,uMsg,wParam,lParam),返回非0拦截
.参数 lParam, 整数型, ,

.判断开始 (uMsg = #WM_PAINT)
zObjBeginPaint (pObj, 取数据_通用型 (ps))
_canvas_clear (ps.pCvs, -1)
hPen = _pen_create (RGB2ARGB (#黑色), 1, 假)
orgX = 80
orgY = 160
hBrush = _brush_create (RGB2ARGB (#天蓝))
_canvas_fillellipse_ex (ps.pCvs, hBrush, orgX, orgY, 3, 3)
_brush_destroy (hBrush)
bin = A2W (“MIND”)
size = _canvas_measure_str (取指针_字节集型 (bin), ps.hFont, 0, 0, 0)
w = 取低位 (size)
h = 取高位 (size)
_canvas_drawtext (ps.pCvs, 取指针_字节集型 (bin), RGB2ARGB (#红色), ps.hFont, ps.hStrfmt, orgX - w - 6, orgY - h ÷ 2 + 2, w, h)
_canvas_drawrect (ps.pCvs, hPen, orgX - w - 8, orgY - h ÷ 2, w + 4, h + 4)
offsetX = orgX + 50
offsetY = 40
.计次循环首 (取数组成员数 (text), i)
size = _canvas_measure_str (取指针_字节集型 (text [i]), ps.hFont, 0, 0, 0)
w = 取低位 (size)
h = 取高位 (size)
_canvas_drawbezier (ps.pCvs, hPen, orgX, orgY, orgX + (offsetX - orgX) × 0.1, orgY + (offsetY - orgY) × 0.6, orgX + (offsetX - orgX) × 0.25, orgY + (offsetY - orgY) × 0.95, offsetX, offsetY)
_canvas_drawtext (ps.pCvs, 取指针_字节集型 (text [i]), RGB2ARGB (#红色), ps.hFont, ps.hStrfmt, offsetX + 2, offsetY - h ÷ 2 + 2, w, h)
_canvas_drawrect (ps.pCvs, hPen, offsetX, offsetY - h ÷ 2, w + 4, h + 4)
offsetY = offsetY + h + 20
.计次循环尾 ()
_pen_destroy (hPen)
zObjEndPaint (pObj)
返回 (1)