I think you are close to my idea, but I explain from beginning:
I have a code:
IDWriteBitmapRenderTarget *pRenderTarget;
hResult = pGDIInterop->CreateBitmapRenderTarget(
NULL,
m_renderTargetWidth,
m_renderTargetHeight,
&pRenderTarget
);
if(FAILED(hResult)) {
m_lastError = L"Failed to create bitmap render target";
}
else {
hResult = pRenderTarget->SetPixelsPerDip(1.0f);
hResult = S_OK;
HDC hDC = pRenderTarget->GetMemoryDC();
if(hDC == NULL) {
m_lastError = L"Failed to get render target DC";
hResult = E_FAIL;
}
else {
HBRUSH hBrush = CreateSolidBrush(RGB(0, 0, 0));
if(hBrush == NULL) {
m_lastError = L"Failed to create brush";
hResult = E_FAIL;
}
else {
HBITMAP hBitmap = static_cast<HBITMAP>(GetCurrentObject(hDC, OBJ_BITMAP));
if(hBitmap == NULL) {
m_lastError = L"GetCurrentObject failed";
hResult = E_FAIL;
}
else {
DIBSECTION dib;
int iResult = GetObject(hBitmap, sizeof(dib), &dib);
if(iResult < sizeof(dib)) {
m_lastError = L"GetObject failed";
hResult = E_FAIL;
}
else {
// Store render target resources and info
m_pRenderTarget = pRenderTarget;
m_hDC = hDC;
m_hBlackBrush = hBrush;
m_bmBits = dib.dsBm.bmBits;
m_bmWidthBytes = static_cast<UINT>(dib.dsBm.bmWidthBytes);
m_bmBytesPixel = static_cast<UINT>(dib.dsBm.bmBitsPixel) / 8;
hResult = S_OK;
}
}
if(FAILED(hResult))
DeleteObject(hBrush);
}
}
if(FAILED(hResult))
pRenderTarget->Release();
}
Api of WIndows 8 doesn't support GetCurrentObject and GetObject, so I can't get m_bmBits, m_bmWidthBytes and m_bmBytesPixel. I noticed, that this values doesn't change, so I can replace that code to static declaration of this variables. With int values that was simple, but with m_bmBits there was a problem, because this is only pointer to adress of memory and I can't see properly values thought Visual Studio debugger(only I see value of this adress). So I had a idea to read from memory this values and I write it down pernamently to code and save to memory after started a program, This will be allow me to use this values in the same way, that I used it before. Can you help me now how can I get a array of this values?