I have a matrix with a lot of number. I have little experience with
graphics, but in order to better understand the numbers I want to paint
the numbers in a canvas in a gradient way.
How can I do that? (Any code is welcomed)
What component should I use?
How to build a palette and associate it with the component?
Thanks much,
Lineu
> I have a matrix with a lot of number. I have little experience with
> graphics, but in order to better understand the numbers I want to paint
> the numbers in a canvas in a gradient way.
>
> How can I do that? (Any code is welcomed)
I wrote a small sample program for someone in Brasil last week that reads
a matrix of numbers from a TXT file and displays them as shades of grade,
or a color "rainbow." Look for the "How to create a Bitmap from numeric
data?" example under "Gray Scale" on this page:
http://www.efg2.com/Lab/Library/Delphi/Graphics/Color.htm
You could easily extend the code for color gradients or other false-color
schemes. You just need to decide on a mapping from your numeric data
to RGB values.
For example, a mapping from wavelength values to RGB functions is
described here:
http://www.efg2.com/Lab/ScienceandEngineering/Spectra.htm
> How to build a palette and associate it with the component?
In general, I would recommend staying away from palettes -- it's
hard to get everything right for all display modes. If you must
use palettes, look for "Palettes, Background Information"
on the "Delphi Color" page given above.
There are a variety of color gradients that are possible without
using palettes. Look for "Color Gradients" links on the same
color page.
You may also be interested in the (non-Delphi) "False Colors" links
on this page as a way to display numeric data:
http://www.efg2.com/Lab/Library/Color/AndComputers.htm
--
efg
Earl F. Glynn E-mail: ef...@efg2.com
Overland Park, KS USA
efg's Computer Lab: http://www.efg2.com/Lab