S
slfeng
Unregistered / Unconfirmed
GUEST, unregistred user!
下面一段代码的初衷是重化窗口界面,结果无效<br>使用兼容内存是为了防止闪动(我画的东西比较多,直接画容易闪动)<br>请兄弟们看看问题出在哪?<br><br>procedure TPasswordForm.FormPaint(Sender: TObject);<br>var width_:longint;<br> height_:longint;<br> DC : HDC;<br> MemDc :HDC;<br> FormHd: HWND;<br> tempCanvas :TCanvas;<br> BOOL1:BOOL;<br>begin<br> tempCanvas := TCanvas.Create();<br><br> DC := self.GetDeviceContext(FormHd);<br><br> tempCanvas.Handle:= CreateCompatibleDC(DC);<br><br><br> //Draw sth. on tempCanvas....<br> ......<br><br> width_ = 10;<br> height_ = 15;<br> <br><br> if BitBlt( DC,<br> 0,<br> 0,<br> width_,<br> height_,<br> tempCanvas.handle,<br> 0,<br> 0,<br> SRCCOPY) <br> then showmessag('error)';<br><br> DeleteDC(self.Canvas.Handle);<br> tempCanvas.Free;<br>end;