// Open a form by ID and add a new image item with alignmentconstform=FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');constimg=UrlFetchApp.fetch('https://www.google.com/images/srpr/logo4w.png');form.addImageItem().setImage(img).setAlignment(FormApp.Alignment.CENTER);
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eFormApp.Alignment\u003c/code\u003e is an enum used to define the alignment of images within a Google Form.\u003c/p\u003e\n"],["\u003cp\u003eImage alignment options include \u003ccode\u003eLEFT\u003c/code\u003e, \u003ccode\u003eCENTER\u003c/code\u003e, and \u003ccode\u003eRIGHT\u003c/code\u003e, which can be accessed using \u003ccode\u003eFormApp.Alignment.LEFT\u003c/code\u003e, \u003ccode\u003eFormApp.Alignment.CENTER\u003c/code\u003e, and \u003ccode\u003eFormApp.Alignment.RIGHT\u003c/code\u003e respectively.\u003c/p\u003e\n"],["\u003cp\u003eYou can set the alignment of an image item in your form using the \u003ccode\u003esetAlignment()\u003c/code\u003e method and passing in the desired \u003ccode\u003eFormApp.Alignment\u003c/code\u003e property.\u003c/p\u003e\n"]]],[],null,["Alignment\n\nAn enum representing the supported types of image alignment. Alignment types can be accessed from\n[FormApp.Alignment](/apps-script/reference/forms/form-app#Alignment).\n\nTo call an enum, you call its parent class, name, and property. For example, `\nFormApp.Alignment.LEFT`.\n\n```javascript\n// Open a form by ID and add a new image item with alignment\nconst form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');\nconst img = UrlFetchApp.fetch('https://www.google.com/images/srpr/logo4w.png');\nform.addImageItem().setImage(img).setAlignment(FormApp.Alignment.CENTER);\n``` \n\nProperties\n\n| Property | Type | Description |\n|----------|--------|------------------------------------------------|\n| `LEFT` | `Enum` | Align the image to the left side of the form. |\n| `CENTER` | `Enum` | Align the image to the center of the form. |\n| `RIGHT` | `Enum` | Align the image to the right side of the form. |"]]