Class AffineTransform
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การเปลี่ยนรูปแบบแบบแอฟฟิน
เมทริกซ์ 3x3 ที่ใช้เปลี่ยนพิกัดต้นทาง (x1, y1) เป็นพิกัดปลายทาง (x2, y2) ตามการคูณเมทริกซ์
[ x2 ] [ scaleX shearX translateX ] [ x1 ]
[ y2 ] = [ shearY scaleY translateY ] [ y1 ]
[ 1 ] [ 0 0 1 ] [ 1 ]
หลังจากการเปลี่ยนรูปแบบ
x2 = scaleX * x1 + shearX * y1 + translateX;
y2 = scaleY * y1 + shearY * x1 + translateY;
เอกสารประกอบโดยละเอียด
getScaleX()
รับองค์ประกอบการปรับขนาดพิกัด X
รีเทิร์น
Number
getScaleY()
รับองค์ประกอบการปรับขนาดพิกัด Y
รีเทิร์น
Number
getShearX()
รับองค์ประกอบการเลื่อนพิกัด X
รีเทิร์น
Number
getShearY()
รับองค์ประกอบการเปลี่ยนรูปพิกัด Y
รีเทิร์น
Number
getTranslateX()
รับองค์ประกอบการแปลพิกัด X เป็นจุด
รีเทิร์น
Number
getTranslateY()
รับองค์ประกอบการแปลพิกัด Y เป็นจุด
รีเทิร์น
Number
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eAffineTransform uses a 3x3 matrix to transform 2D coordinates on a presentation slide.\u003c/p\u003e\n"],["\u003cp\u003eIt allows for scaling, shearing, and translation operations on objects using x and y coordinates.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetScaleX()\u003c/code\u003e, \u003ccode\u003egetScaleY()\u003c/code\u003e, \u003ccode\u003egetShearX()\u003c/code\u003e, \u003ccode\u003egetShearY()\u003c/code\u003e, \u003ccode\u003egetTranslateX()\u003c/code\u003e, and \u003ccode\u003egetTranslateY()\u003c/code\u003e methods provide access to individual transformation elements.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003etoBuilder()\u003c/code\u003e can be utilized for creating a new transform based on an existing one using the AffineTransformBuilder.\u003c/p\u003e\n"]]],["AffineTransform uses a 3x3 matrix to convert source coordinates (x1, y1) to destination coordinates (x2, y2) via matrix multiplication, resulting in x2 = scaleX * x1 + shearX * y1 + translateX and y2 = scaleY * y1 + shearY * x1 + translateY. It provides methods to get scaling elements (getScaleX, getY), shearing elements (getShearX, getY), and translation elements (getTranslateX, getY). A toBuilder method is available to return an AffineTransformBuilder.\n"],null,["# Class AffineTransform\n\nAffineTransform\n\nA 3x3 matrix used to transform source coordinates (x1, y1) into destination coordinates (x2, y2)\naccording to matrix multiplication:\n\n```text\n[ x2 ] [ scaleX shearX translateX ] [ x1 ]\n[ y2 ] = [ shearY scaleY translateY ] [ y1 ]\n[ 1 ] [ 0 0 1 ] [ 1 ]\n```\n\nAfter transformation,\n\n```text\nx2 = scaleX * x1 + shearX * y1 + translateX;\ny2 = scaleY * y1 + shearY * x1 + translateY;\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------------|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|\n| [getScaleX()](#getScaleX()) | `Number` | Gets the X coordinate scaling element. |\n| [getScaleY()](#getScaleY()) | `Number` | Gets the Y coordinate scaling element. |\n| [getShearX()](#getShearX()) | `Number` | Gets the X coordinate shearing element. |\n| [getShearY()](#getShearY()) | `Number` | Gets the Y coordinate shearing element. |\n| [getTranslateX()](#getTranslateX()) | `Number` | Gets the X coordinate translation element in points. |\n| [getTranslateY()](#getTranslateY()) | `Number` | Gets the Y coordinate translation element in points. |\n| [toBuilder()](#toBuilder()) | [AffineTransformBuilder](/apps-script/reference/slides/affine-transform-builder) | Returns a new [AffineTransformBuilder](/apps-script/reference/slides/affine-transform-builder) based on this transform. |\n\nDetailed documentation\n----------------------\n\n### `get``Scale``X()`\n\nGets the X coordinate scaling element.\n\n#### Return\n\n\n`Number`\n\n*** ** * ** ***\n\n### `get``Scale``Y()`\n\nGets the Y coordinate scaling element.\n\n#### Return\n\n\n`Number`\n\n*** ** * ** ***\n\n### `get``Shear``X()`\n\nGets the X coordinate shearing element.\n\n#### Return\n\n\n`Number`\n\n*** ** * ** ***\n\n### `get``Shear``Y()`\n\nGets the Y coordinate shearing element.\n\n#### Return\n\n\n`Number`\n\n*** ** * ** ***\n\n### `get``Translate``X()`\n\nGets the X coordinate translation element in points.\n\n#### Return\n\n\n`Number`\n\n*** ** * ** ***\n\n### `get``Translate``Y()`\n\nGets the Y coordinate translation element in points.\n\n#### Return\n\n\n`Number`\n\n*** ** * ** ***\n\n### `to``Builder()`\n\nReturns a new [AffineTransformBuilder](/apps-script/reference/slides/affine-transform-builder) based on this transform.\n\n#### Return\n\n\n[AffineTransformBuilder](/apps-script/reference/slides/affine-transform-builder)"]]