Magick++: Reading a disk file into an image

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
Bunkai.Satori
Posts: 9
Joined: 2010-10-06T04:05:37-07:00
Authentication code: 8675308

Magick++: Reading a disk file into an image

Post by Bunkai.Satori »

Dear all,

according to the Gentle Introduction to Magick++, page 7 (http://www.imagemagick.org/Magick++/tut ... torial.pdf), i can read the disk file followingly:

Code: Select all

// Reading the contents of a disk file into an image object can be performed
// if the default Image costructor was used
// Example:
Image my_image(); // create an *empty* image using the default Image constructor
my_image.read("aGIFImageFile.gif"); // read a GIF image file from disk;
// the image format is automatically set to GIF

However, the only way how my code gets compiled is if I do not use parentheses when creating Image object:

Code: Select all

Image my_image;
my_image.read("D:\\Test.png");
Is it correct to create my Image object like that?

Regards.
Post Reply