제공된 URL은 공개적으로 액세스 가능한 URL 또는 base64로 인코딩된 이미지 문자열일 수 있습니다.
후자를 얻으려면 다음 코드를 사용하여 Google Drive의 이미지에서 인코딩된 이미지 문자열을 만든 다음 나중에 setImageUrl(imageUrl)와 함께 사용할 수 있도록 이 문자열을 저장하면 됩니다. 이 방법을 사용하면 부가기능이 공개적으로 사용 가능한 이미지 URL에 액세스할 필요가 없습니다.
// The following assumes you have the image to use in Google Drive and have its// ID.constimageBytes=DriveApp.getFileById('123abc').getBlob().getBytes();constencodedImageURL=`data:image/jpeg;base64,${Utilities.base64Encode(imageBytes)}`;// You can store encodeImageURL and use it as a parameter to// CardHeader.setImageUrl(imageUrl).
[[["이해하기 쉬움","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-01-30(UTC)"],[[["`CardHeader` objects allow you to customize the header of a card, including title, subtitle, and image, within Google Workspace Add-ons and Google Chat apps."],["You can set an image for the header using `setImageUrl()` by providing a public URL or a base64 encoded image string."],["`setTitle()` and `setSubtitle()` allow you to define the main text and supporting text for the header, respectively."],["Customize the image display with `setImageStyle()` to control cropping and use `setImageAltText()` to provide alternative text for accessibility."]]],["The `CardHeader` object allows customization of a card's header in Google Workspace add-ons and Google Chat apps. Key actions include setting the header's title using `setTitle()`, a subtitle with `setSubtitle()`, and an image via `setImageUrl()`. The image's appearance can be modified with `setImageStyle()` for cropping and `setImageAltText()` for alternative text. Image URLs can be direct links or base64 encoded strings. Each method returns the `CardHeader` object, enabling method chaining.\n"]]