• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference?

 
Maha Pratap
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey what is the differnce btw direct color model and indexcolor model. thanks.....
maha
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maha,
In simple terms:
1. Index
Each color value represents an index into an array of colors. The array of colors is commonly referred to as a colormap. This restricts the color values to be <= to the number of colors in the map, which has been previously defined (either by the programmer or the system).
2. Direct
Each color value is a packed integer representation of red-blue-green (RGB) combinations. A single integer is usually used which gives 8 bits to each of red/blue/green and 8 bits are for an alpha value. This is the default model used by AWT.
BITS 31 - 24 -- Alpha
BITS 23 - 16 -- Red
BITS 15 - 8 -- Green
BITS 7 - 0 -- Blue
Regards,
Manfred.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!