ATL::CImage GetBits memcpy error 해결
                    
        Unhandled exception at xx , 0xC0000005: Access violation writing location 
   // Get the bitmap image from the stream
    if ((hr = cImage.Load(iStream)) == S_OK)
    {
        // Copy the dib data to the provided buffer
        int pitch = cImage.GetPitch();
        int height = cImage.GetHeight();
        BYTE* pBits = (BYTE*)cImage.GetBits();
        if (pitch < 0)
            pBits += (pitch *(height -1));
        memcpy(captureImage->imageData, pBits, abs(pitch) * height);
    }
//
http://code.google.com/p/open-light/source/browse/trunk/cvStructuredLight/cvCanonCamera.cpp?r=3
반응형
    
    
    
  'Code > Desktop' 카테고리의 다른 글
| [OpenCV]외곽선 검출 (0) | 2014.03.09 | 
|---|---|
| [OpenCV] Mat 사용법 - 이미지 (0) | 2014.03.08 | 
| 콜백함수 (1) | 2014.02.06 | 
| 윈도우즈 디버그 심볼 사용하기 (0) | 2014.02.04 | 
| 프로그램 시작과 동시에 AfxWinMain 에서 에러 (0) | 2014.02.04 | 



