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

Home » Public Forums » archive » 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
24-bit color on printer device [message #32311] Wed, 25 September 2002 12:39
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
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



Sample session with some trimming of device output:

IDL Version 5.5 (IRIX mipseb). (c) 2001, Research Systems, Inc.
Installation number: 8233-51.
Licensed for use by: DEPARTMENT OF METEOROLOGY, TEXAS A&M UNIV.

% Compiled module: MAKE_PATH.

IDL> test24, /verbose
% Compiled module: TEST24.
Available Graphics Devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X Z
Current graphics device: X
Server: X11.0, eXodus 8.0.2b1 (c) 2002 Powerlan USA, Inc., Release 7100
Display Depth, Size: 24 bits, (1600,1002)
Visual Class: TrueColor (4)
Bits Per RGB: 8 (8/8/8)
Physical Color Map Entries (Emulated / Actual): 256 / 256
Colormap: Shared, 16777216 colors. Translation table: Bypassed
Graphics pixels: Decomposed, Dither Method: Ordered
Write Mask: 16777215 (decimal) ffffff (hex)
Graphics Function: 3 (copy)
Current Font: <default>, Current TrueType Font: <default>
Default Backing Store: Req from Server.
Window Status: ---------------------
id typ( x, y, backing store) id typ( x, y, backing store)
0: Win( 640, 512, Req from Server)
** Structure !DEVICE, 17 tags, length=84, data length=84:
NAME STRING 'X'
N_COLORS LONG 16777216
TABLE_SIZE LONG 256

IDL> test24, /verbose, /print
Available Graphics Devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X Z
Current graphics device: PRINTER
File : xprinter.eps
Orientation: Portrait
Scale Factor: 1
Resolution: 301 dots per inch
Font: -adobe-courier-medium-r-normal--0-0-300-300-m-0-iso8859-1, TrueType Font: <none>
Size (X,Y): (17.78,12.7) cm., (7,5) in.
Offset (X,Y): (1.905,12.7) cm., (0.75,5) in.
** Structure !DEVICE, 17 tags, length=84, data length=84:
NAME STRING 'PRINTER'
N_COLORS LONG 16777216
TABLE_SIZE LONG 256
[Message index]
 
Read Message
Previous Topic: TEST -- Ignore
Next Topic: Re: sec : U Re: travelling idl license

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

Current Time: Wed Oct 08 15:34:48 PDT 2025

Total time taken to generate the page: 0.00500 seconds