Re: Saving image and scale...

Hi Carlos,

> My question is: I got a a DisplayImplJ2D with a  RealType mapped to RGB.
> I got a LabeledRGBWidget controlling this map.
> Im able to write the display image to disc, but I want to take the color
> scale of the LabeledRGBWidget to the same image, so I can get a GIF file
> with the display and the scale.
> I dont know how to do it, and  even if I can do it, so a little help is
> needed!! ;-)

You can get the color table as follows:

  ScalarMap rgbMap = new ScalarMap(..., Display.RGB);
  . . .
  ColorControl control = (ColorControl) rgbMap.getControl();
  float[][] table = control.getTable();
  // now save the table with the image

I don't know enough about your file format to know how
you'd save the color table, but at least this code shows
you how to get the table information from VisAD.

Good luck,

  • 2002 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: