马上加入TC
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
bmp。6绘图 画笔 写屏
var hThread, path
功能 执行()
var hdc, hPen, hOld, m_font, m_hwnd, h_图片框
m_hwnd = windowgetmyhwnd()
h_图片框 = 窗口查找子窗口(m_hwnd, "图片框", "Static")
//
hdc = dllcall("user32.dll", "int", "GetWindowDC", "int", h_图片框) //获取当前窗口DC用来显示截图的
hPen = dllcall("gdi32.dll", "int", "CreatePen", "int", 0, "int", 3, "int", #0000FF) //用指定的样式、宽度和颜色,创建一个画笔,并返回一个画笔句柄
hOld = dllcall("gdi32.dll", "int", "SelectObject", "int", hdc, "int", hPen)
traceprint(hOld & "," & hPen)
画直线(hdc, 10, 200, 100, 200)
画矩形(hdc, 10, 10, 100, 100)
//
dllcall("gdi32.dll", "int", "SelectObject", "int", hdc, "int", hOld)
dllcall("user32.dll", "int", "DeleteObject", "int", hPen)
结束
//关键代码回复可见.
[hide]
功能 画直线(hdc, startx, starty, nowx, nowy)
dllcall("gdi32.dll", "int", "MoveToEx", "int", hdc, "int", startx, "int", starty, "int", 0)//画线起点
dllcall("gdi32.dll", "int", "LineTo", "int", hdc, "int", nowx, "int", nowy)//画线终点
结束
//
功能 画矩形(hdc, startx, starty, nowx, nowy)
dllcall("gdi32.dll", "int", "MoveToEx", "int", hdc, "int", startx, "int", starty, "int", 0)
dllcall("gdi32.dll", "int", "LineTo", "int", hdc, "int", startx, "int", nowy)
dllcall("gdi32.dll", "int", "MoveToEx", "int", hdc, "int", startx, "int", starty, "int", 0)
dllcall("gdi32.dll", "int", "LineTo", "int", hdc, "int", nowx, "int", starty)
dllcall("gdi32.dll", "int", "MoveToEx", "int", hdc, "int", startx, "int", nowy, "int", 0)
dllcall("gdi32.dll", "int", "LineTo", "int", hdc, "int", nowx, "int", nowy)
dllcall("gdi32.dll", "int", "MoveToEx", "int", hdc, "int", nowx, "int", starty, "int", 0)
dllcall("gdi32.dll", "int", "LineTo", "int", hdc, "int", nowx, "int", nowy)
结束
[hide] |