hallo gunfire,
es gibt doch die moglich kein einige Grapper an DirectX zu übergeben.
das ist ein ComObjekt. Vorsicht dieses Comobjeckt läuft dann im treiber kontext. Also gilt nicht das sdk sonder das ddk.
hier ist ist der code derdas bild klaut:
Code:
STDMETHODIMP BufferCB( double SampleTime, BYTE * pBuffer, long BufferSize )
{
if(g_bWantBimap)
{
CBitmapData* pBitmapData = new CBitmapData;
if (!pBuffer)
return E_POINTER;
if( pBitmapData->lBufferSize < BufferSize)
{
if (pBitmapData->pBuffer)
{
delete [] pBitmapData->pBuffer;
}
pBitmapData->pBuffer = NULL;
pBitmapData->lBufferSize = 0;
}
// Since we can't access Windows API functions in this callback, just
// copy the bitmap data to a global structure for later reference.
pBitmapData->dblSampleTime = SampleTime;
// If we haven't yet allocated the data buffer, do it now.
// Just allocate what we need to store the new bitmap.
if (!pBitmapData->pBuffer)
{
pBitmapData->pBuffer = new BYTE[BufferSize];
pBitmapData->lBufferSize = BufferSize;
}
if( !pBitmapData->pBuffer )
{
pBitmapData->lBufferSize = 0;
return E_OUTOFMEMORY;
}
// Copy the bitmap data into our global buffer
memcpy(pBitmapData->pBuffer, pBuffer, BufferSize);
// Post a message to our application, telling it to come back
// and write the saved data to a bitmap file on the user's disk.
PostThreadMessage(m_pRoboControlThreadId, WM_CAPTURE_BITMAP, NULL, (long)pBitmapData);
g_bWantBimap = FALSE;
}
return S_OK;
guck dir doch mal den link bei projekt an vielleicht können wir was zu sammen machen
Gruß
Lesezeichen