Hi all,
I am trying to create a BufferedImage manually (e.g. via the constructor) and i
am using the DirectColorModel and the SinglePixelPackedSampleModel. I am trying
to find the optimal models in order to have an image that is rendered fast.
When i use the
Could you please show the code which creates the BufferedImage?
Thanks,
Dmitri
jav...@javadesktop.org wrote:
Hi all,
I am trying to create a BufferedImage manually (e.g. via the constructor) and i
am using the DirectColorModel and the SinglePixelPackedSampleModel. I am trying
to
Of course.
Here is a proc that converts a binary image to a compatible RGB:
public static BufferedImage
convertToSinglePixelPackedSampleModel_BINARY(BufferedImage image) {
int[] bitMasks = new int[]{0x00ff, 0xff00, 0x00ff};
SinglePixelPackedSampleModel sampleModel = new
Of course.
Here is a proc that converts a binary image to a compatible RGB:
[code]
public static BufferedImage
convertToSinglePixelPackedSampleModel_BINARY(BufferedImage image) {
int[] bitMasks = new int[]{0x00ff, 0xff00, 0x00ff};
SinglePixelPackedSampleModel sampleModel =
The problem with your first method is that you are creating the image with
your own DataBuffer. This prohibits this image from ever being cached in video
memory since we can not guarantee that the cache will be up to date with the
original image. Thus the image is unmanageable.
I'm not