Page 1 of 1

How to read an image to put an array?

Posted: 2015-10-26T22:03:27-07:00
by 2049651
Hi.

I don't know where to start from.
I want to read image by imagemagick into array.
My_image.read("c:aaa.jpg"); at this point, there is no error.

I want to put to arrary what I had already read image data.
And I want to write file by using imagemagick library.
Here is my code.

...
master.read("c:₩₩a.jpg");

Image my_image("640x480", "white");
my_image.modifyImage();
Pixels my_pixel_cache(my_image);
PixelPacket* pixels;
int start_x = 0, start_y = 0, size_x = 640, size_y = 480;
*pixels = Color("black");
*(pixels+200) = Color("green");
my_pixel_cache.sync();

...

But I can't get array of a.jpg. How to get a.jpg image data to array to modify?