Re: [問題] 有擷取螢幕的功能嗎 ?
現在才看到這篇.
就是用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
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章