Answered by:
Opencv Mat to Id2d1Bimap Directx

Question
-
I have to render opencv Mat to using DirectX 11.
D2D1_BITMAP_PROPERTIES1 bitmapProperties = D2D1::BitmapProperties1( D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW, D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE), 96, 96 ); D2D1_SIZE_U s = D2D1::SizeU(640, 480); hr = m_d2DeviceContext->CreateBitmap(s, bitmapProp, &m_streamBitmap);
I have to copy opencv matrix to m_streamBitmap. pImage is a color image with 3 channels.
m_streamBitmap->CopyFromMemory(NULL, reinterpret_cast<BYTE*>(pImage.data),pImage.cols()*3);
This gives distorted image as result.
Can anyone guide me with this.
Thanks in advance ..
- Edited by vivek1may Thursday, July 19, 2018 4:43 AM
Thursday, July 19, 2018 4:37 AM
Answers
-
- Proposed as answer by Richard MuellerMVP, Banned Thursday, July 19, 2018 12:04 PM
- Marked as answer by Richard MuellerMVP, Banned Thursday, July 26, 2018 12:31 PM
Thursday, July 19, 2018 6:10 AM -
or for help with DirectX I'd ask over here.
http://xboxforums.create.msdn.com/forums/default.aspx?GroupID=7
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Richard MuellerMVP, Banned Thursday, July 19, 2018 12:04 PM
- Marked as answer by Richard MuellerMVP, Banned Thursday, July 26, 2018 12:31 PM
Thursday, July 19, 2018 11:59 AM
All replies
-
- Proposed as answer by Richard MuellerMVP, Banned Thursday, July 19, 2018 12:04 PM
- Marked as answer by Richard MuellerMVP, Banned Thursday, July 26, 2018 12:31 PM
Thursday, July 19, 2018 6:10 AM -
or for help with DirectX I'd ask over here.
http://xboxforums.create.msdn.com/forums/default.aspx?GroupID=7
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Richard MuellerMVP, Banned Thursday, July 19, 2018 12:04 PM
- Marked as answer by Richard MuellerMVP, Banned Thursday, July 26, 2018 12:31 PM
Thursday, July 19, 2018 11:59 AM