I'm working on winapi gui application, that displays liveview images from Canon DSLR with EDSDK API. During testing I successfully display test image with this code:
Rect destRect(15, 15, 620, 413);
HDC hdc = GetDC(hwndDlg);
Graphics graphics(hdc);
Bitmap* myBitmap = new Bitmap(L"test.jpg");
graphics.DrawImage(myBitmap, destRect);
ReleaseDC(hwndDlg, hdc);
But I can't imagine how to replace "test.jpg" with values from this function:
EdsError downloadEvfData(EdsCameraRef camera)
{
EdsError err = EDS_ERR_OK;
// Create memory stream.
err = EdsCreateMemoryStream(0, &stream);
// Create EvfImageRef.
if(err == EDS_ERR_OK)
{
err = EdsCreateEvfImageRef(stream, &evfImage);
}
// Download live view image data.
if(err == EDS_ERR_OK)
{
err = EdsDownloadEvfImage(camera, evfImage);
}
err = EdsGetPointer(stream, (EdsVoid**) &data);
if (err != EDS_ERR_OK)
{
cout << "Download Live View Image Error in Function EdsGetPointer: " << err << "\n";
return false;
}
err = EdsGetLength(stream, &length);
if (err != EDS_ERR_OK)
{
cout << "Download Live View Image Error in Function EdsGetLength: " << err << "\n";
return false;
}
Any help will be highly appreciated!