Y
yaya_ccvi
Unregistered / Unconfirmed
GUEST, unregistred user!
我在程序中需要随着鼠标的移动不段的画线,我打开进程管理器,发现我的程序占用的内存不段增加,怎么解决这个问题呢?代码如下:
DC:=tcanvas.create;
n_top:= Y - m_top;
n_left:= X - m_Left;
n_width:= m_width;
n_height:= m_height;
dc.Pen.Color:=clbtnText;
DC.handle:=getdc(panel_test.Handle);
DC.MoveTo(n_left,n_top);
DC.LineTo(n_left,n_top+n_height);
DC.MoveTo(n_left,n_top+n_height);
DC.LineTo(n_left+n_width,n_top+n_height);
DC.MoveTo(n_left+n_width,n_top+n_height);
DC.LineTo(n_left+n_width,n_top);
DC.MoveTo(n_left+n_width,n_top);
DC.LineTo(n_left,n_top);
old_y:=n_top;
old_x:=n_left;
DC.Destroy();
DC:=tcanvas.create;
n_top:= Y - m_top;
n_left:= X - m_Left;
n_width:= m_width;
n_height:= m_height;
dc.Pen.Color:=clbtnText;
DC.handle:=getdc(panel_test.Handle);
DC.MoveTo(n_left,n_top);
DC.LineTo(n_left,n_top+n_height);
DC.MoveTo(n_left,n_top+n_height);
DC.LineTo(n_left+n_width,n_top+n_height);
DC.MoveTo(n_left+n_width,n_top+n_height);
DC.LineTo(n_left+n_width,n_top);
DC.MoveTo(n_left+n_width,n_top);
DC.LineTo(n_left,n_top);
old_y:=n_top;
old_x:=n_left;
DC.Destroy();