Hi,
we are trying to watermark images, no matter what type. in the tests following your Examples, for png it works well, but not for emf files. Image was loaded properly but drawString didn’t worked.
“Exception in thread “main” class com.aspose.imaging.internal.Exceptions.ArgumentNullException: Value cannot be null.
Parameter name: image”
any idea?
here is the code:
Image tmpImg = Image.load("f_lb37.emf");
Graphics tmpGr = new Graphics(tmpImg);
// Creates an instance of Font
Font font = new Font("Times New Roman", 50, FontStyle.Bold);
// Create an instance of SolidBrush and set its properties
SolidBrush brush = new SolidBrush();
brush.setColor(Color.getGray());
brush.setOpacity(100);
// Draw a string using the SolidBrush and Font objects at specific point
tmpGr.drawString("Watermark TEST", font, brush, new PointF(tmpImg.getWidth()/2, tmpImg.getHeight()/2));
// Save image
tmpImg.save("test_watermark.emf");