This SWT snippet SWT ImageData
にBufferedImage
を変換:ComponentColorModelを持つBufferedImageをSWT ImageDataに変換するにはどうすればよいですか?
static ImageData convertToSWT(BufferedImage bufferedImage) {
if (bufferedImage.getColorModel() instanceof DirectColorModel) {
...
} else if (bufferedImage.getColorModel() instanceof IndexColorModel) {
...
}
return null;
}
問題はColorModel
の第三のサブクラスであり、である:ComponentColorModel
は。そして私はこのカラーモデルを使ってイメージを変換する必要があります。どうすればいいのですか?ロマノフの答えでhere見つかり
で
をこれも必要になる場合があります'data.transparentPixel'の修正です。 –