comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: 24-bit color on printer device
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: 24-bit color on printer device [message #32301 is a reply to message #32294] Thu, 26 September 2002 07:23 Go to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
Kenneth Bowman wrote:
> I have a short program (posted below) to test 24-bit color. On a 24-bit
> X-Windows display, it works as intended, blending red and green to get yellow.
>
> The printer device does not produce color output, however. As evidenced
> by the xprinter.eps file filled with, e.g.
>
> ...
> 0.4 setgray
> gs np 325.44 176.88 t 325.44 176.88 lo 331.68 176.88 ...
>
> (also by opening xprinter.eps in Illustrator and Ghostview).
>
> Any ideas?
>
> Many thanks, Ken Bowman
>
> PRO TEST24, PRINT = print, VERBOSE = verbose
>
> IF KEYWORD_SET(print) THEN BEGIN
> entry_device = !D.NAME
> SET_PLOT, 'PRINTER'
> DEVICE, /TRUE_COLOR
> ENDIF
> !P.BACKGROUND = 255 + 256*(255 + 256*255) ;White background
>
> n = 1000L
> x = RANDOMU(seed, n) ;Random numbers [0, 1]
> y = RANDOMU(seed, n) ;Random numbers [0, 1]
> r = LONG(255*x) ;Red proportional to x
> g = LONG(255*y) ;Green proportional to y
> b = REPLICATE(0B, n) ;No blue
>
> PLOT, [0,0], [1,1], /NODATA, COLOR = 0 + 256*(0 + 256*255) ;Blue axes
> PLOTS, x, y, PSYM=1, COLOR = r + 256*(g + 256*b) ;Red-green-yellow points
>
> IF KEYWORD_SET(verbose) THEN BEGIN
> HELP, /DEVICE
> HELP, !D, /STRUCT
> ENDIF
>
> IF KEYWORD_SET(print) THEN BEGIN
> DEVICE, /CLOSE
> SET_PLOT, entry_device
> ENDIF
>
> END
[stuff deleted]

I get the same result in IDL 5.5 for IRIX when I use the default PRINTER
output device (Generic EPS). However if I select printer-specific output
using

result = dialog_printersetup()

and select the 'HP Color LaserJet PS on FILE:', then I get 24-bit color
output as expected. IDL remembers this setting via the
$HOME/.XprinterDefaults file, so the next time I start IDL, this printer
is the default when the PRINTER device is selected.

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Namespaces (redux)
Next Topic: volume rendering in IDLgrVolume

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 04:48:32 PDT 2025

Total time taken to generate the page: 1.27835 seconds