Repository navigation
docs: show how to display an image from a byte array - #6264
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preview DeploymentThis PR has been deployed for preview. URL: https://docs-preview-pr-6264.fly.dev Changed pagesAdded content is highlighted in green; removed content is marked in red on each page.
Built from 2f6f267 |
Moves the byte-array image example from the Grid renderers page to the Add Images and Icons how-to, where it stands on its own without a Grid. The example now passes a file name with an extension so that the MIME type is detected, and sets the alternative text explicitly. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
I moved the example from the Grid renderers page to the Add Images and Icons how-to. The only Grid-specific part was While moving it, I also fixed the example. The second constructor argument is the image name, not the alt text: its extension is used to guess the MIME type, and it becomes the alt text only by default. The example now passes a file name with an extension, sets the alt text with |
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review risk: two-way door: docs only. It adds one short section to the Add Images and Icons how-to.
Summary
Adds an Images from Byte Arrays section to
articles/building-apps/ui-basics/add-images-icons.adoc. It shows how to display an image stored as a byte array, such as a profile picture loaded from a database. Until now theImage(byte[], …)constructors weren't documented anywhere.What changed
new Image(byte[], String). The second argument is a file name: its extension determines the MIME type, and it also becomes the default alt text, so the example sets a descriptive alt text withsetAlt().new Image(byte[], String, String), for when the file name has no recognizable extension or the MIME type is stored separately.DownloadHandler, as explained in the section above it.Test summary
Image(byte[], String)constructor was compiled against the docs project's Vaadin version. The snippets are inline.🤖 Generated with Claude Code