The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Both your examples are wrong. As Magick said, MagickGetImageHistogram returns an array of PixelWands and the second argument is a *pointer* to an integer which *returns* the number of wands (unique colours). You are trying to pass an integer to MagickGetImageHistogram when you should be receiving one from it.
e.g.
int num_wands;
PixelWand **pw_array;
.
.
.
pw_array = MagickGetImageHistogram(magick_wand , &num_wands);
// Check for valid result
if(!pw_array || !num_wands) {
// Handle the error - there's no histogram
.
.
}
// Now handle the pixel wands returned
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.