我用了paintbox画图形,不过每次都要在paint事件里重绘,不然就会消息,画图时间比较长,看起来很不自然
有没有办法在画过之后就不用重绘

解决方案 »

  1.   

    重绘是必须的,不过如果绘制过程比较慢的话可以把画好的保存至内存,paint事件中直接从内存BitBlt
      

  2.   

    怎么画到内存里?
    不会刚学delphi,请指教~~
      

  3.   

    画到image里; image.canvas....
    或者是 
    var bmp:TBitmap;
    begin
      bmp := tbitmap.create;
      bmp.width = 640;
      bmp.height = 480;
      bmp.canvas.... //画
      最后用image 显示
     image.picture.assign(bmp);
    end;
      

  4.   

    仔细看了一下,好像有些细节不对,最后还是用BitBlt比较好
      

  5.   

    bitmap := TBitmap.Create;
    bitmap.Height:=70;
    bitmap.Width:=70;
    bitmap.Canvas.FloodFill(0,0,clNone,fsSurface);
    bitmap.Canvas.Ellipse(t);
    windows.BitBlt(Canvas.Handle,10,10,70,70,bitmap.Canvas.Handle,0,0,windows.SRCCOPY);
    bitblt 是这样用的
    BOOL BitBlt(    HDC hdcDest, // handle to destination device context 
        int nXDest, // x-coordinate of destination rectangle's upper-left corner
        int nYDest, // y-coordinate of destination rectangle's upper-left corner
        int nWidth, // width of destination rectangle 
        int nHeight, // height of destination rectangle 
        HDC hdcSrc, // handle to source device context 
        int nXSrc, // x-coordinate of source rectangle's upper-left corner  
        int nYSrc, // y-coordinate of source rectangle's upper-left corner
        DWORD dwRop  // raster operation code 
       );