Magic++ Draw on a TIFF image and output as a TIFF
Posted: 2007-06-13T14:35:47-07:00
Hello,
I am trying to draw text on a TIFF image and save it. But I cannot open the file on windows, I can open it using ImageMagic Display but not with anyother image viewer. See code below....
#include <Magick++.h>
#include <string>
#include <iostream>
using namespace std;
using namespace Magick;
int main( int /*argc*/, char ** argv)
{
// Initialize ImageMagick install location for Windows
InitializeMagick(*argv);
try {
Image button;
char input[] = "1775899A.tif";
button.read(input);
std::list<Magick::Drawable> drawList;
drawList.push_back(DrawablePointSize(30));
drawList.push_back(DrawableText(150, 100, "NAUSHAD THAHA"));
button.draw(drawList);
button.write("1775899A_NT.TIF");
}
catch( exception &error_ )
{
cout << "Caught exception: " << error_.what() << endl;
return 1;
}
return 0;
}
I am trying to draw text on a TIFF image and save it. But I cannot open the file on windows, I can open it using ImageMagic Display but not with anyother image viewer. See code below....
#include <Magick++.h>
#include <string>
#include <iostream>
using namespace std;
using namespace Magick;
int main( int /*argc*/, char ** argv)
{
// Initialize ImageMagick install location for Windows
InitializeMagick(*argv);
try {
Image button;
char input[] = "1775899A.tif";
button.read(input);
std::list<Magick::Drawable> drawList;
drawList.push_back(DrawablePointSize(30));
drawList.push_back(DrawableText(150, 100, "NAUSHAD THAHA"));
button.draw(drawList);
button.write("1775899A_NT.TIF");
}
catch( exception &error_ )
{
cout << "Caught exception: " << error_.what() << endl;
return 1;
}
return 0;
}