最好给个源码,分不够说话!小弟在此谢了!!

解决方案 »

  1.   

    给你个截图的例子参考procedure TForm1.ScreenCap(LeftPos, TopPos, RightPos, BottomPos: integer);
    var
      RectWidth,RectHeight:integer;
      SourceDC,DestDC,Bhandle:integer;
      Bitmap:TBitmap;
    begin
      RectWidth:=RightPos-LeftPos;
      RectHeight:=BottomPos-TopPos;
      SourceDC:=CreateDC('DISPLAY','','',nil);
      DestDC:=CreateCompatibleDC(SourceDC);
      Bhandle:=CreateCompatibleBitmap(SourceDC,RectWidth,RectHeight);
      SelectObject(DestDC,Bhandle);
      BitBlt(DestDC,0,0,RectWidth,RectHeight,SourceDC,LeftPos,TopPos,SRCCOPY);
      Bitmap:=TBitmap.Create;
      Bitmap.Handle:=BHandle;
      BitMap.SaveToStream(BmpStream);
      BmpStream.Position:=0;
      LeftSize:=BmpStream.Size;
      Bitmap.Free;
      DeleteDC(DestDC);
      ReleaseDC(Bhandle,SourceDC);
    end;