c++ - DesktopImageInSystemMemory of DXGI_OUTDUPL_DESC -


i need variable true can use mapdesktopsurface of idxgioutputduplication

how set true. previous settings can done.

here link

http://msdn.microsoft.com/en-us/library/windows/desktop/hh404622(v=vs.85).aspx

i faced same problem...so need do:

the mapdesktopsurface method of times return dxgi_error_unsupported image not in system memory, in gpu memory.

in case, need transfer image gpu memory system memory.

so how that?

  1. create descriptor id3d11texture2d of type d3d11_texture12d_desc.

  2. use getdesc on image(id3d11texture2d) acquired using idxgioutputduplication::acquirenextframe fill in descriptor.

  3. this descriptor has framedescriptor.usage set d3d11_usage_default.

  4. you need set descriptor following parameters (let others remain is):

    framedescriptor.usage = d3d11_usage_staging; framedescriptor.cpuaccessflags = d3d11_cpu_access_read; framedescriptor.bindflags = 0; framedescriptor.miscflags = 0; framedescriptor.miplevels = 1; framedescriptor.arraysize = 1; framedescriptor.sampledesc.count = 1; 
  5. now, create new staging buffer (id3d11texture2d) using above descriptor follows:

    m_device->createtexture2d(&framedescriptor, null, &newid3d11texture2d); 
  6. copy contents of acquired image staging buffer follows:

    m_devicecontext->copyresource(newid3d11texture2d, m_acquireddesktopimage); 
  7. important: release acquired frame using idxgioutputduplication::releaseframe()

  8. now can process newtexture (newid3d11texture2d) wish!!!!!

map if want...

this should enough answering query...if want more information, can check out msdn pages or ask through comments...


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -