Bitmap to hex array conversion in c++ using opencv

I am new to OpenCV. I have to convert a monochrome bitmap to a one dimensional array. What I have done so far is that I have read the image file and shown it in a window.

#include <cv.h>
#include <highgui.h>
using namespace cv;
int main( int argc, char** argv )
cv::Mat image;
image = imread("imaje.bmp");
return 0;
cv::imshow("Image", image);
return 0;

The image array is stored in variable named as "image" . I need to get that variable in some text format as I need to send these bytes to a printer. Please guide me how should I proceed ?? Thanks
Topic archived. No new replies allowed.