This is the code:
string localPhotoPath = @“C:…\image1.jpg”;
using (Aspose.Imaging.Image waterImage = Aspose.Imaging.Image.Load(localPhotoPath))
float waterOpacity = 0.9f;
Aspose.Imaging.Color waterColor = Aspose.Imaging.Color.Gold;
int waterOpacityAlpha = (int)(waterOpacity * 255 + 0.5);
waterColor = Aspose.Imaging.Color.FromArgb(waterOpacityAlpha, waterColor);
Aspose.Imaging.Brushes.SolidBrush waterSolidBrush = new Aspose.Imaging.Brushes.SolidBrush(waterColor);
Aspose.Imaging.Graphics waterGraphics = new Aspose.Imaging.Graphics(waterImage);
waterGraphics.DrawString(“17 June 2022 at 11:25”, new Aspose.Imaging.Font(“Arial”, 12f), waterSolidBrush, new Aspose.Imaging.PointF(10, waterImage.Height - 25));
This is part of a web app that runs in IIS.
IIS app pool has a setting named “Load User Profile”
When it is set to false (default value), this code does nothing. - no exception, no text added to the image.
When it is set to true, the code works.