Last active
March 7, 2025 10:20
Draw Circle in Java. For further details: https://kb.aspose.com/drawing/java/draw-circle-in-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
// Create bitmap and load into graphics object | |
com.aspose.drawing.Bitmap BitmapImage = new com.aspose.drawing.Bitmap(512, 512, | |
com.aspose.drawing.imaging.PixelFormat.Format32bppPArgb); | |
com.aspose.drawing.Graphics GraphicsFromImage = | |
com.aspose.drawing.Graphics.fromImage(BitmapImage); | |
// Create a pen tool and draw circle | |
com.aspose.drawing.Pen PenTool = new com.aspose.drawing.Pen(com.aspose.drawing.Color.getGreen(), 3); | |
GraphicsFromImage.drawEllipse(PenTool, 20, 20, 400, 400); | |
// Save output png file | |
BitmapImage.save("Circle.png"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment