Class IconImage
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
आइकॉनइमेज
पहले से तय आइकॉन, मटीरियल डिज़ाइन आइकॉन या यूआरएल से लिया गया आइकॉन, जिसे अपनी पसंद के मुताबिक काटा जा सकता है.
ज़्यादा जानकारी वाला दस्तावेज़
setAltText(altText)
यूआरएल का वैकल्पिक टेक्स्ट सेट करता है. इसका इस्तेमाल, सुलभता के लिए किया जाता है.
पैरामीटर
नाम | टाइप | ब्यौरा |
altText | String | वैकल्पिक टेक्स्ट. |
वापसी का टिकट
IconImage
— चेन करने के लिए यह ऑब्जेक्ट.
setIcon(icon)
अगर यूआरएल सेट नहीं है, तो पहले से तय आइकॉन सेट करता है. डिफ़ॉल्ट रूप से, इसकी वैल्यू NONE होती है.
पैरामीटर
नाम | टाइप | ब्यौरा |
icon | Icon | पहले से तय की गई Icon वैल्यू में से कोई एक. |
वापसी का टिकट
IconImage
— चेन करने के लिए यह ऑब्जेक्ट.
setIconUrl(url)
अगर आइकॉन सेट नहीं है, तो आइकॉन का यूआरएल सेट करता है.
पैरामीटर
नाम | टाइप | ब्यौरा |
url | String | होस्ट की गई इमेज का यूआरएल पता, जिसे आइकॉन के तौर पर इस्तेमाल किया जाना है. |
वापसी का टिकट
IconImage
— चेन करने के लिए यह ऑब्जेक्ट.
setImageCropType(imageCropType)
इमेज के लिए काटने का स्टाइल सेट करता है. आइकॉन के लिए, काट-छांट के इन विकल्पों का इस्तेमाल किया जा सकता है: SQUARE
और CIRCLE
. डिफ़ॉल्ट रूप से SQUARE
होता है.
पैरामीटर
नाम | टाइप | ब्यौरा |
imageCropType | ImageCropType | लागू करने के लिए ImageCropType विकल्प. |
वापसी का टिकट
IconImage
— चेन करने के लिए यह ऑब्जेक्ट.
setMaterialIcon(icon)
मटीरियल डिज़ाइन आइकॉन सेट करता है.
const iconImage = CardService.newIconImage().setMaterialIcon(
CardService.newMaterialIcon().setName('search'),
);
पैरामीटर
वापसी का टिकट
IconImage
— चेन करने के लिए यह ऑब्जेक्ट.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eIconImage\u003c/code\u003e allows you to display a predefined or custom icon using a URL.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize the icon's appearance with a specific crop style (SQUARE or CIRCLE).\u003c/p\u003e\n"],["\u003cp\u003eAlternative text can be set for accessibility purposes using \u003ccode\u003esetAltText()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esetIcon()\u003c/code\u003e and \u003ccode\u003esetIconUrl()\u003c/code\u003e methods allow you to specify the icon source, either a predefined icon or a URL.\u003c/p\u003e\n"],["\u003cp\u003eAll methods return the \u003ccode\u003eIconImage\u003c/code\u003e object, enabling method chaining for streamlined configuration.\u003c/p\u003e\n"]]],["The `IconImage` object allows setting an icon using predefined options, a material design icon, or a URL. Key actions include: setting alternative text for accessibility (`setAltText`), choosing a predefined icon (`setIcon`), specifying an icon URL (`setIconUrl`), defining the image crop style (`setImageCropType`), and selecting a material design icon (`setMaterialIcon`). Each method returns the `IconImage` object for chaining additional actions.\n"],null,["# Class IconImage\n\nIconImage\n\nA predefined icon, a material design icon, or an icon from a URL with a customizable crop style. \n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------------------------|----------------|-----------------------------------------------------------------------|\n| [setAltText(altText)](#setAltText(String)) | [IconImage](#) | Sets the alternative text of the URL which is used for accessibility. |\n| [setIcon(icon)](#setIcon(Icon)) | [IconImage](#) | Sets the predefined icon if the URL is not set. |\n| [setIconUrl(url)](#setIconUrl(String)) | [IconImage](#) | Sets the URL of the icon if the icon is not set. |\n| [setImageCropType(imageCropType)](#setImageCropType(ImageCropType)) | [IconImage](#) | Sets the crop style for the image. |\n| [setMaterialIcon(icon)](#setMaterialIcon(MaterialIcon)) | [IconImage](#) | Sets the material design icon. |\n\nDetailed documentation\n----------------------\n\n### `set``Alt``Text(altText)`\n\nSets the alternative text of the URL which is used for accessibility.\n\n#### Parameters\n\n| Name | Type | Description |\n|-------------|----------|-----------------------|\n| `alt``Text` | `String` | The alternative text. |\n\n#### Return\n\n\n[IconImage](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Icon(icon)`\n\nSets the predefined icon if the URL is not set. Default is NONE.\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|--------------------------------------------------|--------------------------------------------------------------------------------|\n| `icon` | [Icon](/apps-script/reference/card-service/icon) | One of the predefined [Icon](/apps-script/reference/card-service/icon) values. |\n\n#### Return\n\n\n[IconImage](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Icon``Url(url)`\n\nSets the URL of the icon if the icon is not set.\n\n#### Parameters\n\n| Name | Type | Description |\n|-------|----------|------------------------------------------------------|\n| `url` | `String` | The URL address of a hosted image to use as an icon. |\n\n#### Return\n\n\n[IconImage](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Image``Crop``Type(imageCropType)`\n\nSets the crop style for the image. The crop type options you can use for icons are `SQUARE\n` and `CIRCLE`. Default is `SQUARE`.\n\n#### Parameters\n\n| Name | Type | Description |\n|---------------------|----------------------------------------------------------------------|------------------------------------|\n| `image``Crop``Type` | [ImageCropType](/apps-script/reference/card-service/image-crop-type) | The ImageCropType option to apply. |\n\n#### Return\n\n\n[IconImage](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Material``Icon(icon)`\n\nSets the material design icon.\n\n```javascript\nconst iconImage = CardService.newIconImage().setMaterialIcon(\n CardService.newMaterialIcon().setName('search'),\n);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|-------------------------------------------------------------------|--------------------|\n| `icon` | [MaterialIcon](/apps-script/reference/card-service/material-icon) | The material icon. |\n\n#### Return\n\n\n[IconImage](#) --- This object, for chaining."]]