Re: [問題] 有擷取螢幕的功能嗎 ?

看板C_Sharp (C#)作者 (icools)時間19年前 (2006/07/16 16:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
謝謝我後來有找到了... 先引入 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
文章代碼(AID): #14kVcNGZ (C_Sharp)
文章代碼(AID): #14kVcNGZ (C_Sharp)