From 826cb178bf448a54d41425268a1fc83c5c5e3b8b Mon Sep 17 00:00:00 2001 From: aiwan1088 Date: Fri, 8 Nov 2024 18:05:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib8baa4bc153915fdd51a4b0f23927cf46fe03b8c Signed-off-by: aiwan1088 --- .../native_drawing/drawing_canvas.h | 36 +++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 8 +++++ 2 files changed, 44 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_canvas.h b/graphic/graphic_2d/native_drawing/drawing_canvas.h index f78e6127f..83ebdc23f 100644 --- a/graphic/graphic_2d/native_drawing/drawing_canvas.h +++ b/graphic/graphic_2d/native_drawing/drawing_canvas.h @@ -398,6 +398,25 @@ void OH_Drawing_CanvasDrawOval(OH_Drawing_Canvas*, const OH_Drawing_Rect*); */ void OH_Drawing_CanvasDrawArc(OH_Drawing_Canvas*, const OH_Drawing_Rect*, float startAngle, float sweepAngle); +/** + * @brief Draws an arc with use center. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param cCanvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param cRect Indicates the pointer to an OH_Drawing_Rect object. + * @param startAngle Indicates the startAngle of the arc. + * @param sweepAngle Indicates the sweepAngle of the arc. + * @param useCenter If true, include the center of the oval in the arc, and close it if it is being stroked. + * This will draw a wedge. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if cCanvas or cRect is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawArcWithCenter(OH_Drawing_Canvas* cCanvas, const OH_Drawing_Rect* cRect, + float startAngle, float sweepAngle, bool useCenter); + /** * @brief Draws a roundrect. * @@ -409,6 +428,23 @@ void OH_Drawing_CanvasDrawArc(OH_Drawing_Canvas*, const OH_Drawing_Rect*, float */ void OH_Drawing_CanvasDrawRoundRect(OH_Drawing_Canvas*, const OH_Drawing_RoundRect*); +/** + * @brief Draw two nested rounded rectangles. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param cCanvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param outer Rounded rectangle object, representing the outer rounded rectangle boundary. + * @param inner Rounded rectangle object, representing the internal rounded rectangle boundary. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of cCanvas, outer + * and inner is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawNestedRoundRect(OH_Drawing_Canvas* cCanvas, const OH_Drawing_RoundRect* outer, + const OH_Drawing_RoundRect* inner); + /** * @brief Draws a single character. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 353ce3f53..e3adebd64 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1721,5 +1721,13 @@ { "first_introduced": "14", "name":"OH_Drawing_GetRunGlyphCount" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_CanvasDrawNestedRoundRect" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_CanvasDrawArcWithCenter" } ] \ No newline at end of file -- Gitee