At 11:00 AM -0400 05/19/98, Geoffrey S. Knauth wrote:
>If I recall correctly, 32-bit color is [Red][Green][Blue][Alpha].  If
>some layer were confused and just masked off the lower 24-bits, you'd
>lose [Red].  Switching to 24-bit color would make the problem appear
>to go away.

It all depend on the Color Model you are using of course.
The default is [Alpha][Red][Green][Blue]

http://java.sun.com/products/jdk/1.1/docs/api/java.awt.image.ColorModel.html#get
RGBdefault()


public static ColorModel getRGBdefault()

      Return a ColorModel which describes the default format for integer
RGB values used throughout the AWT image interfaces. The format for the RGB
values is an integer with 8 bits each of alpha, red, green, and blue color
components ordered correspondingly from the most significant byte to the
least significant byte, as in: 0xAARRGGBB


But using the java.awt.image.DirectColorModel class you can define your own.


public DirectColorModel(int bits,
                         int rmask,
                         int gmask,
                         int bmask,
                         int amask)

      Constructs a DirectColorModel from the given masks specifying which
bits in the pixel contain the alhpa, red, green and blue color components.
All of the bits in each mask must be contiguous and fit in the specified
number of least significant bits of the integer.


Cheers,
Paul


Reply via email to