GetDIBits to OfPixels

Hi everyone,

I got the pixels from GetDIBits function like below.

cv::Mat src;
GetDIBits(hwindowCompatibleDC,hbwindow,0,height,,(BITMAPINFO *)&bi,DIB_RGB_COLORS);

I can use unsigned char pointer or array instead of “” above. I have to transmit this pixel data to ofpixels.

I’ve tried this

OfPixels screenPixels;

I got the error that “Access violation reading location”

So how can i fill ofPixels with raw pixel data ?

Or how can i convert cv::Mat to ofPixels ?


I have used this code to converting cv::Mat src to ofImage Img and take decision to using ofimage instead of ofpixels.