作者ithinkurdumb (祝有情人终成父母)
看板C_Sharp
标题Re: [问题] 有撷取萤幕的功能吗 ?
时间Sun Jul 16 19:41:33 2006
现在才看到这篇.
就是用GDI32作没错,
(DirectX也行, 不过比较麻烦)
抓完图之後记得要作cleanup:
User32.ReleaseDC(User32.GetDesktopWindow(), hdcSrc);
GDI32.DeleteDC(hdcDest);
GDI32.DeleteObject(hBitmap);
※ 引述《icools (icools)》之铭言:
: 谢谢我後来有找到了...
: 先引入 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)》之铭言:
: : WinAPI: BitBlt
: : or using DirectX
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.135.60.155