Hi,
I suspect that this question will have a very simple answer (hoping,
anyway).
I want to display an image using color table 6 but this color table
does not have white in it. Next I want to display a white crosshairs
on top of the image. The way that I do this is not ideal because I am
loading the black-white color table after displaying the color image
in the window but before I draw the crosshairs (see test code below).
The reason that this is not ideal is that, in my application, I am
really moving this crosshairs around the screen as the cursor moves
over the image. Motion events are being generated resulting in many
calls to loadct, slowing down the whole works.
I guess what I am really asking for is a persistent way to specify the
color of something as white (for instance) when a particular color
table has been loaded. I suspect that I can replace one of the color
table entries with [255,255,255] for instance? I just am not sure how
to do this.
Any help you can give is greatly appreciated!
Best regards,
Rob
--
Robert M. Dimeo, Ph.D.
NIST Center for Neutron Research
National Institute of Standards and Technology
100 Bureau Drive - Stop 8562
Gaithersburg, MD 20899-8562
Telephone: (301) 975-8135
FAX: (301) 921-9847
www.ncnr.nist.gov/staff/dimeo
www.ncnr.nist.gov/instruments/hfbs
------------------------
pro test_color
loadct,6,/silent
window,xsize = 225,ysize = 225,/free & winVis = !d.window
window,/free,/pixmap,xsize = 225,ysize = 225 & winPix = !d.window
image = smooth(byte(255*randomn(s,225,225,/uniform)),5,/edge_truncat e)
wset,winPix
tv,image
wset,winVis
device,copy = [0,0,!d.x_size,!d.y_size,0,0,winPix]
loadct,0,/silent
plots,[0,225],[112,112],linestyle = 0,/device
plots,[112,112],[0,255],linestyle = 0,/device
empty
wdelete,winPix
return
end
|