Setting pixels on monochrome picture fails

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Change
  • PixelPacket *pixels = view.get(columns,rows,width,height);
to
  • PixelPacket *pixels = view.get(columns,rows,1,1);
and your program should work. You should always check the return value. In your program pixels was being returned as NULL and you can't write to a NULL pointer.
Post Reply