当前位置: 代码迷 >> PB >> 用这个代码画线,次次画都是以坐标0.0为起点。所有办法都试过了
  详细解决方案

用这个代码画线,次次画都是以坐标0.0为起点。所有办法都试过了

热度:83   发布时间:2016-04-29 07:18:13.0
用这个代码画线,每次画都是以坐标0.0为起点。所有办法都试过了
int ii_x,ii_y
ulong l_handle, l_device 

strpos pos_zb

ii_x = 1000
ii_y = 1000
pos_zb.xpos=1000
pos_zb.ypos=1000
//SetCapture(handle(This))
l_handle = handle(w_base)
l_device = GetDC(l_handle)
ii_x = unitstopixels(ii_x,XUnitsToPixels!)   
ii_y = unitstopixels(ii_y,yUnitsToPixels!)
ulong newPen
newPen = CreatePen(1,2, rgb(255,0,0)) 

SelectObject(l_device, newPen) 

MoveToEx(l_device,ii_x,ii_y,pos_zb)  
LineTo(GetDC(handle(w_base)),30,20)  



------解决方案--------------------
检查MoveToEx函数是否执行成功
  相关解决方案