Support rounded rectangle in Graphics class #9001
Labels
api-approved
(4) API was approved in API review, it can be implemented
area-System.Drawing
System.Drawing issues
🚧 work in progress
Work that is current in progress
Milestone
Background and motivation
In modern interfaces, rounded rectangles are used in many places instead of right-angled rectangles, such as github buttons and labels.
GDI has RoundRect, but GDI+ doesn't have a direct equivalent. We can, however, do the necessary path generation in GDI+ to implement this fairly common request.
The current Graphics class provides Graphics.DrawRectangle and Graphics.FillRectangle to support drawing rectangles, but currently there is no corresponding method for drawing rounded rectangles.
API Proposal
API Usage
graphics.DrawRoundedRectangle(new Pen(Color.Black), new Rectangle(0, 0, 100, 100), new Size(5, 5));
graphics.FillRoundedRectangle(new SolidBrush(Color.Black), new Rectangle(0, 0, 100, 100), new Size(5, 5));
The text was updated successfully, but these errors were encountered: