【发布时间】:2012-01-12 13:00:15
【问题描述】:
This SWT snippet 将 BufferedImage 转换为 SWT ImageData:
static ImageData convertToSWT(BufferedImage bufferedImage) {
if (bufferedImage.getColorModel() instanceof DirectColorModel) {
...
} else if (bufferedImage.getColorModel() instanceof IndexColorModel) {
...
}
return null;
}
问题是,ColorModel 的第三个子类:ComponentColorModel。我需要使用此颜色模型转换图像。我该怎么做?
【问题讨论】:
标签: java swt awt bufferedimage