Gdiplus::Bitmap mem_dc(Width, Height, PixelFormat32bppARGB );
Gdiplus::Graphics g(&mem_dc);
HDC hDC = g.GetHDC();
DllObject->Render(hDC);
g.ReleaseHDC(hDC);
In the DLL I have a 3rd party sdk that can use the hDC or a gdiplus bitmap, I have tried both ways but I have having a problem rendering transparency.
Gdiplus::Bitmap mem_dc(m_CanvasWidth, m_CanvasHeight, PixelFormat32bppARGB );
m_pView->Render(mem_dc);
Gdiplus::Graphics g(hDC);
g.DrawImage(&mem_dc, 0.0f, 0.0f);
The sdk draws an blended overlay that I draw on top of another image, but when I render with these methods it seems to have already blended with black.
Using the sdk directly rather than in a DLL and a bitmap works as I want it. You might ask why I don't do that, well I am doing terrible things... The sdk is old so I am wrapping it in a DLL with a pure virtual interface so I can use it a different compiler, my test set up for this seems to work (this is based on a codeproject article http://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL#CppMatureApproach ), and that is why I am passing a HDC across the boundary. If anyone knows if this is somehow possible with gdiplus objects that would be great.
Thanks