locked
How to solve that SaveToWICFile() return General access denied error ? (Win 8.0 APP DirectX C++/Cx)

    Question

  • My purpose get DirectX screen picture in Win 8.0 app( Using C++/CX)

    Using CaptureTexture and SaveToWICFile to finish this function.

    DirectX::CaptureTexture  return S_OK. 

    Then, Running SaveToWICFile return General access denied error .

    I miss something?

    Below my Code

    DirectX::ScratchImage DxImage;
     HRESULT hr_0 = DirectX::CaptureTexture(  m_d3dDevice.Get() , m_d3dContext.Get() , depthStencil.Get() , DxImage );
     const Image* img = DxImage.GetImages();
     HRESULT hr = SaveToWICFile( *img, DirectX::WIC_FLAGS_NONE , GUID_ContainerFormatJpeg , L"C:\\Users\\StevenHuang\\Documents\\output_tex.jpg", NULL );
     
     if ( FAILED(hr) )
     {
      ;// error
     }

    Monday, January 27, 2014 9:42 AM

Answers

All replies