Page 1 of 1

Magick++: Reading a disk file into an image

Posted: 2010-10-06T05:06:31-07:00
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.