0
PrimeFaces 6.1にpng画像を表示するのが難しいです。Primefaces 6.1の黒い背景の画像表示
イメージは、データベースからバイト配列形式でロードされました。 jpgはうまく表示されていますが、pngは常に黒い背景で表示されます。他のすべてのjpg表示適切
public StreamedContent getImage() throws IOException {
FacesContext context = FacesContext.getCurrentInstance();
if (context.getCurrentPhaseId() == PhaseId.RENDER_RESPONSE) {
// So, we're rendering the HTML. Return a stub StreamedContent so that it will generate right URL.
return new DefaultStreamedContent();
}
else {
// So, browser is requesting the image. Return a real StreamedContent with the image bytes.
String fileId = context.getExternalContext().getRequestParameterMap().get("fileId");
File file = (File) fileBean.getFileCache().get(fileId);
return new ByteArrayContent(file.getThumbnail(),file.getFileType(),file.getFileName());
}
}
が、PNG形式の画像は、1私の質問に設定した透明になりますよう
<p:graphicImage value="#{fileControlBean.image}">
<f:param name="fileId" value="#{file.fileId}" />
</p:graphicImage>
とバック豆:
この
は、JSFのために私のコードスニペットを次のとおりです。どのように透明に戻すことができますか?それともバグですか?