-
Notifications
You must be signed in to change notification settings - Fork 187
Description
Describe your motivation
Add a shortcut Image constructor to ease usage.
public Image(byte[] imageContent, String imageName) {
this.setSrc(DownloadHandler.fromInputStream(event -> {
return new DownloadResponse(new ByteArrayInputStream(imageContent), imageName,
URLConnection.guessContentTypeFromName(imageContent), imageContent.length
);
}).inline());
this.setAlt(imageName);
}
Additional context
https://vaadin.com/forum/t/streamresource-used-to-set-image-src/178326/2
Copilot
Metadata
Metadata
Assignees
Type
Projects
Status
Maybe