作者icools (icools)
看板C_Sharp
标题Re: [问题] 有撷取萤幕的功能吗 ?
时间Sun Jul 16 16:34:46 2006
谢谢我後来有找到了...
先引入 GDI32 DLL
//for capture Screen
int hdcSrc = User32.GetWindowDC(User32.GetDesktopWindow()),hdcDest = GDI32.CreateCompatibleDC(hdcSrc), hBitmap = GDI32.CreateCompatibleBitmap(hdcSrc,GDI32.GetDeviceCaps(hdcSrc,8),GDI32.GetDeviceCaps(hdcSrc,10));
GDI32.SelectObject(hdcDest,hBitmap);
GDI32.BitBlt(hdcDest,0,0,GDI32.GetDeviceCaps(hdcSrc,8), GDI32.GetDeviceCaps(hdcSrc,10), hdcSrc,0,0,0x00CC0020);
之後hBitmap就会得到要撷取的图片了..
※ 引述《xsoe (n/a)》之铭言:
: ※ 引述《icools (icools)》之铭言:
: : 我有想过这个方法...
: : 然後从剪贴簿抠出来..
: : 不过还是想知道有没有直接抓图的功能...
: : 因为用sendkeys 不太保险
: WinAPI: BitBlt
: or using DirectX
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.142.30.203