Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Difference?

 
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
 
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.
 
I didn't do it. You can't prove it. Nobody saw me. The sheep are lying! This tiny ad is my witness!
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!