| 发表于:2007-08-06 15:48:20 楼主 |
如何在onmousemove中给鼠标加上移动线? 就是一条黑线可以左右移动 void cmyview::onmousemove(uint nflags, cpoint point) { cdc* pdc=getdc(); struct { int xleft; int xright; int ytop; int ybottom; }scurverect; gxleft=1500; scurverect.xleft=gxleft; scurverect.xright=20100; scurverect.ytop=4000; scurverect.ybottom=-4000; int ibottomspace=80;//底部空白 //设置坐标 pdc-> setmapmode(mm_anisotropic); crect rectclient,rectclient2; getclientrect(rectclient); pdc-> setmapmode(mm_anisotropic); pdc-> setwindowext(csize(20400,11720)); pdc-> setviewportext(rectclient.right,-rectclient.bottom); pdc-> setviewportorg(rectclient.left,rectclient.bottom/2-ibottomspace); //设置窗口左下角为原点坐标 if (point.x*20> scurverect.xright) point.x=scurverect.xright/20; if (point.x*20 <scurverect.xleft) point.x=scurverect.xleft/20; pdc-> moveto(point.x*20,scurverect.ytop); pdc-> lineto(point.x*20,scurverect.ybottom); cview::onmousemove(nflags, point); } 但是这样上次画的线都没有被清除,过一会就全黑了。 如果用 invalidaterect()就非常flash了。。。 |
|
|
|
|