Here is conversion to Bitmap:
DWORD *local_bit_map_buffer;
local_bit_map_buffer = new DWORD[cxImage*cyImage];
for(int local_counter_width=0;local_counter_width<cxImage;local_counter_width++)
{
for(int local_counter_height=0;local_counter_height<cyImage;local_counter_height++)
{
int local_couter = local_counter_width+local_counter_height*cxImage;
int local_bit_map_couter = local_counter_width+(cyImage-(local_counter_height+1))*cxImage;
local_bit_map_buffer[local_bit_map_couter] = RGB_BYTE_ORDER(prgb[local_couter].rgbtRed,prgb[local_couter].rgbtGreen,prgb[local_couter].rgbtBlue);
}
}
HBITMAP handle_bit_map = NULL;
handle_bit_map = CreateBitmap(
cxImage,
cyImage,
1,
32,
local_bit_map_buffer);
delete []local_bit_map_buffer;
HDC hdc;
local_handle_result = gImageSrc->GetDC(&hdc);
if (local_handle_result!=D3D_OK)
{
return E_FAIL;
}
HDC hdc_compatible = CreateCompatibleDC(hdc);
if (hdc_compatible==NULL)
{
return E_FAIL;
}
if(SelectObject(hdc_compatible,handle_bit_map)==NULL)
{
return E_FAIL;
}
if(!BitBlt(hdc, 0 ,0 ,cxImage , cyImage , hdc_compatible, 0, 0, SRCCOPY))
{
return E_FAIL;
}
if(gImageSrc->ReleaseDC(hdc))
{
return E_FAIL;
}
DeleteDC(hdc_compatible);
BOOL local_result = DeleteObject(handle_bit_map);
if(!local_result)
{
return E_FAIL;
}