I am using the following code to resize the image. Now, i need to apply the watermark on this image using Magick.NET.
var response = client.GetObject(request).ResponseStream;
MagickImage image = new MagickImage(response);
MagickGeometry size = new MagickGeometry(imgWidth, imgHeight);
size.IgnoreAspectRatio = maintainAspectRatio;
image.Resize(size);
Bitmap watermarkObj = (Bitmap)Bitmap.FromFile("G:/Images/watermark.png");
Graphics imageGraphics = Graphics.FromImage(image.ToBitmap());
Point point = new Point(image.Width - 118, image.Height - 29);
imageGraphics.DrawImage(watermarkObj, point);
image.write("G:/Images/ProcessedImage.JPG");
Working Code :
MagickGeometry size = new MagickGeometry(imgWidth, imgHeight);
size.IgnoreAspectRatio = maintainAspectRatio;
image.Resize(size);
Bitmap watermarkObj = (Bitmap)Bitmap.FromFile("G:/Images/watermark.png");
Bitmap objImg = new Bitmap("G:/Images/OriginalImage.jpg");
Graphics imageGraphics = Graphics.FromImage(objImg);
Point point = new Point(image.Width - 118, image.Height - 29);
imageGraphics.DrawImage(watermarkObj, point);
objImg.save("G:/Images/ProcessedImage.JPG");
So, Can anyone help me how to do it with using imagemagick? Reason being when i pass imageObject in graphics it doesn't apply the watermark where as when i pass the .net image object it apply the watermark.