bitblt sdk_bitblt_c# bitblt(2)

电脑杂谈  发布时间:2017-02-12 05:04:37  来源:网络整理

Height := Bottom - Top;

ScreenDC := GetDC( 0 );

try

BitBlt( Canvas.Handle, 0, 0, Width, Height, ScreenDC,

Left, Top, SRCCOPY );

finally

ReleaseDC( 0, ScreenDC );

end;

end;

end;

{==============================================================================}

{ Use this to capture the entire screen... }

function CaptureScreen: TBitmap;

{==============================================================================}

begin

with Screen do

bitblt sdk_bitblt_c# bitblt

Result := CaptureScreenRect( Rect( 0, 0, Width, Height ));

end;

{==============================================================================}

{ Use this to capture just the client area of a form or control... }

function CaptureClientImage( Control: TControl ): TBitmap;

{==============================================================================}

begin

with Control, Control.ClientOrigin do

Result := CaptureScreenRect( Bounds( X, Y, ClientWidth,

ClientHeight ));

end;

{==============================================================================}

{ Use this to capture an entire form or control... }

function CaptureControlImage( Control: TControl ): TBitmap;

{==============================================================================}

begin

with Control do

if Parent = nil then

Result := CaptureScreenRect( Bounds( Left, Top, Width,

Height ))

else

with Parent.ClientToScreen( Point( Left, Top )) do

Result := CaptureScreenRect( Bounds( X, Y, Width,

Height ));

end;

{==============================================================================}

{ Use this to capture an entire form or control paased as an API hWnd... }

function CaptureWindowImage( Wnd: HWND ): TBitmap;

{==============================================================================}

var

R: TRect;

begin

GetWindowRect(Wnd, R);

Result := CaptureScreenRect(R);

end;

end.


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-31929-2.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 权雪洁
      权雪洁

      教训一下

    • 张衡
      张衡

      其目的是试探中国在南海岛屿的底线

    • 齐武公吕寿
      齐武公吕寿

      这种确实不会生虫

    热点图片
    拼命载入中...