Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Painting a matrix of number

0 views
Skip to first unread message

Lineu Rodrigues

unread,
Sep 20, 2000, 3:00:00 AM9/20/00
to
Hi everyone!

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


Earl F. Glynn

unread,
Sep 20, 2000, 3:00:00 AM9/20/00
to
"Lineu Rodrigues" <lin...@unlserve.unl.edu> wrote in message
news:39C8C59F...@unlserve.unl.edu...

> 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


0 new messages