Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can try getting the desktop window (<a href="http://msdn.microsoft.com/en-us/library/ms633504(VS.85).aspx" rel="nofollow noreferrer"><code>GetDesktopWindow</code></a>) and then getting a device context for it (<a href="http://msdn.microsoft.com/en-us/library/dd144947(VS.85).aspx" rel="nofollow noreferrer"><code>GetWindowDC</code></a>), then create a compatible in-memory device context (<a href="http://msdn.microsoft.com/en-us/library/dd183489(VS.85).aspx" rel="nofollow noreferrer"><code>CreateCompatibleDC</code></a>), create a compatible bitmap from the desktop dc (<a href="http://msdn.microsoft.com/en-us/library/dd183488(VS.85).aspx" rel="nofollow noreferrer"><code>CreateCompatibleBitmap</code></a>), select it in the in-memory dc (<a href="http://msdn.microsoft.com/en-us/library/dd162957(VS.85).aspx" rel="nofollow noreferrer"><code>SelectObject</code></a>) and then do bit-blitting fo the region you are interested from the desktop dc into the in-memory dc(<a href="http://msdn.microsoft.com/en-us/library/dd183370(VS.85).aspx" rel="nofollow noreferrer"><code>BitBlt</code></a>). Don't forget to cleanup after all this.</p> <p>Oh, and if you are doing this in managed code, you can find all these APIs on <a href="http://pinvoke.net" rel="nofollow noreferrer">PInvoke.net</a>. You'll also need to use <a href="http://msdn.microsoft.com/en-us/library/system.windows.interop.imaging.createbitmapsourcefromhbitmap.aspx" rel="nofollow noreferrer"><code>Imaging.CreateBitmapSourceFromHBitmap</code></a> to copy the bitmap from the native bitmap into the managed bitmap.</p> <p>I am writing all this from memory; it used to work on XP, but I have not tried it on Vista or Win7.</p> <p><strong>EDIT:</strong> A quick search on the web for ".Net screen capture" returns couple of hits, including <a href="http://www.developerfusion.com/code/4630/capture-a-screen-shot/" rel="nofollow noreferrer">this one</a> with sample code in C# and VB.Net.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload