COM コンポーネントがあります。この COM コンポーネントは、画面に画像を表示します。イメージ ビットは、次のようにバッファーを介してコピーされます。
IplImage iplimage = image;
IplImage *img2 = cvCreateImage(cvGetSize(&iplimage),
iplimage.depth,
iplimage.nChannels);
cvCopy(&iplimage, img2);
memcpy(m_BackSurface.vpBits, img2->imageData, img2->width*img2->height*3);
imagecv::Mat はどこにありますか。特定の条件では、これはトリミングされた cv::Mat です。raw_image(x0, y0, w, h)whereの戻り値raw_imageは別の cv::Mat です。
その後、アプリケーションはStretchBlt画像を表示するために呼び出します。
If I'm running this COM component inside a .NET application (and only when inside a .NET application this doesn't occurs on a pure unmanaged environment) the call to StretchBlt fails when (again, only when) image has been cropped. It does not fail on the code path where image isn't cropped. The drawing code is the same for both code paths. GetLastError() will return the error 8.
Can someone shed a light on this issue?