How to pass the buffer into image array?

here is .h file code:

and here is .cpp code:

actually I just want to put buffer[ ] into an image array…