Okay, so this code does not even work and it is off of the API page.
I have to admit, this has a potential to be a great tool but the documentation and support really
the big one! Only 1 example of the code usage in the entire site. Plus, I see a lot of 0 replies on this forum.
How do I use the MagickSetImageFormat() function? Please just give an example of code that works that creates a tiny image from a pixel array.
Code: Select all
$magick_wand = NewMagickWand();
MagickSetWandSize($magick_wand, 200, 200);
MagickSetImagePixels( $magick_wand, 34, 77, 4, 8, 'BRG', MW_CharPixel, array( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //pixels (34,77) (35,77) (36,77) (37,77)
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, //pixels (34,78) (35,78) (36,78) (37,78)
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, //pixels (34,79) (35,79) (36,79) (37,79)
128,128,128, 128,128,128, 128,128,128, 128,128,128, //pixels (34,80) (35,80) (36,80) (37,80)
160,160,160, 160,160,160, 160,160,160, 160,160,160, //pixels (34,81) (35,81) (36,81) (37,81)
192,192,192, 192,192,192, 192,192,192, 192,192,192, //pixels (34,82) (35,82) (36,82) (37,82)
224,224,224, 224,224,224, 224,224,224, 224,224,224, //pixels (34,83) (35,83) (36,83) (37,83)
255,255,255, 255,255,255, 255,255,255, 255,255,255 //pixels (34,84) (35,84) (36,84) (37,84)
) );
MagickSetImageFormat($magick_wand, 'jpg');
header('Content-Type: image/jpeg');
MagickEchoImageBlob( $magick_wand );