You can find all the details at: Add Signature to an Image in Java
Last active
March 21, 2022 20:52
-
-
Save aspose-com-gists/d72d992adedda680245e5ae82be94650 to your computer and use it in GitHub Desktop.
Add Signature on Image Programmatically in Java | Sign Image
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
// Create an instance of Image class to load the primary image | |
Image canvas = Image.load("layers.psd"); | |
// Load the secondary image containing the signature graphics | |
Image signature = Image.load("sample.psd"); | |
// Create an instance of Graphics class to load the primary image | |
Graphics graphics = new Graphics(canvas); | |
// Call the DrawImage method with appropriate location | |
// This code draws the secondary image at the right bottom of the primary image | |
graphics.drawImage(signature, new Point(canvas.getHeight() - signature.getHeight(), canvas.getWidth() - signature.getWidth())); | |
// Save output image in PNG format | |
canvas.save("ImageSignature.png", new PngOptions()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment