PDA

View Full Version : Overloading functions


NorrisP
Jan8-06, 03:22 PM
Will overloading in Java create clumpsy look,use ?

Also, in ordor to draw with color, will you chose to create 16, 32,64,128,256 color modes ? which one you often chose ?
Thanks you very much

dduardo
Jan8-06, 03:35 PM
1) There is nothing wrong with function/operator overloading.

2) Pick the number of colors you want to use. If you need 256 colors, then go with that, if not pick less. It is completely dependent on your application.

NorrisP
Jan8-06, 04:57 PM
thank you dduardo, but if 256, 256 mean I must create 256 array of color ?
but what if it bigger than 256 like a million of color.?
I need create many color, i see my computer have million color, i need distingush each of them.

dduardo
Jan8-06, 05:09 PM
If the library your using only has support for 8bits = = 2^8 = 256 colors and you need something like 16bit, 24bit or 32bit colors than you need to find a library that handles that amount. Unless your drawing pictures, 256 colors is probably more than enough. The java 2d library supports 32bit colors. 8bits for red 8 bits for green and 8 bits for blue = 32bit RGB.

If you want CYMK, that's a whole other story.

NorrisP
Jan8-06, 05:22 PM
please can you suggest me library ?

dduardo
Jan8-06, 05:23 PM
http://java.sun.com/products/java-media/2D/index.jsp

Here is a tutorial on it:

http://www.apl.jhu.edu/~hall/java/Java2D-Tutorial.html

NorrisP
Jan8-06, 05:30 PM
thank you a lot