You can find more details at: Create a PSD Image in C#
Last active
March 16, 2022 08:18
-
-
Save aspose-com-gists/c2123ec26043dfd22c7da2a8062be78c to your computer and use it in GitHub Desktop.
How to create PSD file in C# | How to make a PSD
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 a new image from scratch | |
PsdImage image = new PsdImage(450, 450); | |
// Fill image data | |
Graphics graphics = new Graphics(image); | |
graphics.Clear(Color.White); | |
// Draw a rectangle | |
graphics.DrawRectangle(new Pen(new SolidBrush(Color.Blue)), new Rectangle(10, 30, 80, 40)); | |
// Draw a ellipse shape by specifying the Pen object, color and coordinates | |
graphics.DrawEllipse(new Pen(new SolidBrush(Color.Red)), new Rectangle(60, 80, 130, 90)); | |
// Add a text layer | |
image.AddTextLayer("Sample text", new Rectangle(150, 220, 100, 130)); | |
// Save output PSD file | |
image.Save("CreatePSD.psd"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment