rt

解决方案 »

  1.   

    var
      aCanvas:TCanvas;
    begin
      aCanvas:=TCanvas.Create;
      
      try
      aCanvas.Handle:=GetDC(0);
      {
       //在此你就可以随便画了
       aCanvas.lineto(500,500);
      }
      finally
        aCanvas.Free;
      end;
    end;
      

  2.   

    canvas要realease要不就可能有内存泄漏,我刚从书上看的。
      

  3.   

    同意1楼。。HDC GetDC(
      HWND hWnd   // handle to a window
    );
     
    Parameters
    hWnd 
    Handle to the window whose device context is to be retrieved. If this value is NULL, GetDC retrieves the device context for the entire screen.