3/19/2024 0 Comments Fabric js load png black![]() The following example shows how to draw an arc: canvas.StrokeColor = Colors.Teal Ĭanvas.DrawArc(10, 10, 100, 100, 0, 180, true, false) The clockwise argument specifies the direction in which the arc is drawn, and the closed argument specifies whether the end point of the arc will be connected to the start point. The endAngle argument specifies the angle from the x-axis to the end point of the arc. The startAngle argument specifies the angle from the x-axis to the starting point of the arc. ![]() Draw an arcĪrcs can be drawn on an ICanvas using the DrawArc method, which requires x, y, width, height, startAngle, and endAngle arguments of type float, and clockwise and closed arguments of type bool. There are DrawRoundedRectangle and FillRoundedRectangle overloads that take Rect and RectF arguments, and overloads that enable the radius of each corner to be separately specified. The FillColor property of the ICanvas object must be set to a Color before invoking the FillRoundedRectangle method. In this example, a green filled rectangle with rounded corners and dimensions 100x50 is drawn at (10,10): In this example, a green rectangle with rounded corners and dimensions 100x50 is drawn at (10,10):įor information about drawing a dashed rounded rectangle, see Draw dashed objects.Ī filled rounded rectangle can be drawn with the FillRoundedRectangle method, which also requires x, y, width, height, and cornerRadius arguments, of type float: canvas.FillColor = Colors.Green Ĭanvas.FillRoundedRectangle(10, 10, 100, 50, 12) ![]() The following example shows how to draw a rounded rectangle: canvas.StrokeColor = Colors.Green Ĭanvas.DrawRoundedRectangle(10, 10, 100, 50, 12) The cornerRadius argument specifies the radius used to round the corners of the rectangle. Rounded rectangles and squares can be drawn on an ICanvas using the DrawRoundedRectangle method, which requires x, y, width, height, and cornerRadius arguments, of type float. There are DrawRectangle and FillRectangle overloads that take Rect and RectF arguments. The FillColor property of the ICanvas object must be set to a Color before invoking the FillRectangle method. In this example, a dark blue filled rectangle with dimensions 100x50 is drawn at (10,10): In this example, a dark blue square with dimensions 100x100 is drawn at (10,10):įor information about drawing a dashed rectangle, see Draw dashed objects.Ī filled rectangle can be drawn with the FillRectangle method, which also requires x, y, width, and height arguments, of type float: canvas.FillColor = Colors.DarkBlue To draw a square, make the width and height arguments to the DrawRectangle method equal: canvas.StrokeColor = Colors.DarkBlue In this example, a dark blue rectangle with dimensions 100x50 is drawn at (10,10): The following example shows how to draw a rectangle: canvas.StrokeColor = Colors.DarkBlue Rectangles and squares can be drawn on an ICanvas using the DrawRectangle method, which requires x, y, width, and height arguments, of type float. In addition, there are also DrawCircle and FillCircle overloads. There are DrawEllipse and FillEllipse overloads that take Rect and RectF arguments. ![]() In this example, a red circle with dimensions 100x100 is drawn at (10,10): To draw a circle, make the width and height arguments to the DrawEllipse method equal: canvas.StrokeColor = Colors.Red In this example, a red ellipse with dimensions 100x50 is drawn at (10,10): The following example shows how to draw an ellipse: canvas.StrokeColor = Colors.Red Draw an ellipseĮllipses and circles can be drawn on an ICanvas using the DrawEllipse method, which requires x, y, width, and height arguments, of type float. In this example, a red dashed diagonal line is drawn from (10,10) to (90,100):įor more information about dashed lines, see Draw dashed objects. The following example shows how to draw a dashed line: canvas.StrokeColor = Colors.Red Ĭanvas.StrokeDashPattern = new float There's also a DrawLine overload that takes two PointF arguments. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |