unknown wrote:
some one can give me a portable source codes that color a pixel?
(env *nix)
Well, I haven't ranted on this topic in a while so
here goes:
There is no standard for a pixel, other than the vague
definition that it is a picture element. A pixel could
be a vertical line, a dot (circle) or a vector, perhaps
even something more complex. Thus, it is not portable
already.
Not all platforms have displays. Those platforms that
have displays, may not have pixels or have access to
those pixels. Thus pixels are not portable.
For Raster display systems, pixels are usually either
dots or vertical lines (check your monitor). Here
are some varying attributes for a pixel:
dimensions (width and height, maybe depth)
black & white vs. color
discreet values vs. blends
intensity
The fact is that there is no standard for the above
attributes. Some platforms may add more attributes
to a pixel, such as blinking. Thus more reasons why
pixels are not portable.
Let us assume that a pixel can be colored. Now the
questions are:
1. How many colors?
2. Standard colors, such as cobalt blue and purple?
How does one turn a pixel "olive green" on a Windows
platform and have it the same value on a Unix machine?
Finally, let us think about the issues about additive
colors versus subtractive colors. Colors on a CRT
{Cathode Ray Tube} may not be the same as on an ink
jet printer.
The best answer for how to do graphics is to consult
the documents for your platform.
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq:
http://www.parashift.com/c++-faq-lite
C Faq:
http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library