Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active March 19, 2022 23:33
Show Gist options
  • Save aspose-com-gists/3282f54b177fff588150dc78dd0f647e to your computer and use it in GitHub Desktop.
Save aspose-com-gists/3282f54b177fff588150dc78dd0f647e to your computer and use it in GitHub Desktop.
Add Signature to an Image Programmatically in C#
// Create an instance of Image to load the primary image
using (Image canvas = Image.Load("layers.psd"))
{
// Create another instance of Image class to load the secondary image with signature
using (Image signature = Image.Load("sample.psd"))
{
// Create an instance of Graphics class
Graphics graphics = new Graphics(canvas);
// Call the DrawImage method while specifying the appropriate location
//Here the secondary image is drawn at the right bottom of the primary image
graphics.DrawImage(signature, new Point(canvas.Height - signature.Height, canvas.Width - signature.Width));
canvas.Save("ImageSignature.png", new PngOptions());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment