Last active
September 24, 2022 17:42
-
-
Save GroupDocsGists/0760dbd15da12362fa4e2f12cee2a073 to your computer and use it in GitHub Desktop.
Add Image Watermark to Images using C# & Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add PNG Image Watermark on an Image using C# | |
using (Watermarker watermarker = new Watermarker("filePath/image.png")) | |
{ | |
using (ImageWatermark watermark = new ImageWatermark("filePath/watermarkLogo.png")) | |
{ | |
// Set Watermark Properties | |
watermark.X = 20; | |
watermark.Y = 80; | |
// Add watermark on image file and save the output | |
watermarker.Add(watermark); | |
watermarker.Save("filePath/outputImage.png"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add PNG Image Watermark to JPG using Java | |
ImageWatermark watermark = new ImageWatermark(Constants.Watermark_PNG); | |
watermark.setX(20); | |
watermark.setY(80); | |
// Add watermark to the source JPG Image and save the output | |
Watermarker watermarker = new Watermarker(Constants.JPG_IMAGE); | |
watermarker.add(watermark); | |
watermarker.save(Constants.JPG_IMAGE_OUTPUT); | |
watermark.close(); | |
watermarker.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment