blockly > IMetricsManager > getContentMetrics
طريقة IMetricsManager.getContentMetrics()
تحصل على مقاييس المحتوى إما بإحداثيات البكسل أو مساحة العمل. منطقة المحتوى عبارة عن مستطيل حول جميع العناصر المحددة لأعلى في مساحة العمل (تعليقات وكتل مساحة العمل).
Signature:
getContentMetrics(opt_getWorkspaceCoordinates?: boolean): ContainerRegion;
المعلمات
المعلمة |
النوع |
الوصف |
opt_getWorkspaceCoordinates |
منطقي |
(اختياري) يتم الضبط على "صحيح" للحصول على مقاييس المحتوى في إحداثيات مساحة العمل، وعلى "خطأ" للحصول عليها في إحداثيات البكسل. |
المرتجعات:
ContainerRegion
مقاييس حاوية المحتوى
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-10-14 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-10-14 (حسب التوقيت العالمي المتفَّق عليه)"],[[["The `getContentMetrics()` method calculates the size and position of the area containing all blocks and comments on a Blockly workspace."],["It allows you to retrieve these measurements in either pixel or workspace coordinates by using the optional `opt_getWorkspaceCoordinates` parameter."],["The method returns a `ContainerRegion` object which holds the calculated dimensions and position of the content area."]]],["The `getContentMetrics()` method retrieves content metrics, representing a rectangle around all top-level elements (blocks and comments) on the workspace. It accepts an optional boolean parameter, `opt_getWorkspaceCoordinates`. When `true`, it returns metrics in workspace coordinates; when `false` or omitted, it returns metrics in pixel coordinates. The method's output is a `ContainerRegion` object, containing the content container's metrics.\n"]]