1

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?

4

1 に答える 1

2

MSDN によると、エラー コード 8 はに対応しERROR_NOT_ENOUGH_MEMORYます。.NET 環境で実行しているため、CLR がプロセスに読み込まれるため、使用可能なメモリが少なくなります。メモリ使用量を減らし、メモリ リークも探す必要があります。

于 2011-08-23T15:23:07.623 に答える