[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Raster image to file



Date: Wed, 9 May 90 16:27 EDT
To: davel%whutt.att.com@vax.cam.nist.gov, slug%AI.SRI.COM@vax.cam.nist.gov
In-Reply-To: The message of 9 May 90 16:06 EDT from davel@whutt.att.com
Message-ID: <19900509202704.3.MILLER@ARTEMIS.cam.nist.gov>

    Date: Wed, 9-May-90 16:06:27-EDT
    Date: Wed, 9 May 90 15:11 EDT

    I have no doubt that this has been asked before, but I don't know the
    answer and I thought someone out there would.  I would like to dump
    a color screen to a file in a way analogous to <function-Q>.  I would
    be happy with any format which could then be redisplayed, but I would
    need a description of the format (the files may be displayed on an X
    server).  Could someone explain how to do this or send the code 
    necessary?

    Thanks

    David Loewenstern

This is a bit tricky in the current state of affairs, what with all  the
map modes &  who knows  what; unless  I'm missing  something.  You might
think that  you  would  like  to  get  the  raster and read the RGB out,
writing into any  format you  like; easy  right?  The  catch is that the
screen array can be anything  from 8 to 32  bits containing any sort  of
bizzare encoding of the  colors; possibly even  RGB.  The kind  of color
hardware you have generally  only restricts the  set of things  that the
raster can contain;  a 24bit  system still  doesn't necessarily  contain
24bit RGB! So  you can  just store  the raster,  but you've  also got to
store the info that allows you to interpret it (whatever that is!)

As an  alternative  (slow),  there  is  a  message  to  get the RGB at a
particular pixel :RGB-FOR-COLOR, so you  can just scan the  screen doing
that.  Maybe there  are higher  level ones  too; I'm  really quite naive
about the color system.

bruce
miller@cam.nist.gov