I am trying to copy the pixels of an image so I can send them over a socket connection. However, I get a EXC_BAD_ACCESS on the memcpy below:
ofImage img;
img.loadImage(filename);
img.setImageType(OF_IMAGE_COLOR);
int sizeOfImage = img.width*img.height*3;
...
unsigned char * pxs = img.getPixels();
memcpy(message->payload_, pxs, sizeOfImage);
Am I doing something wrong here? This seems to be logical…
Thanks for any help!