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

Home » Public Forums » archive » device,cursor_image ??
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
device,cursor_image ?? [message #14687] Tue, 23 March 1999 00:00 Go to next message
Craig Hamilton is currently offline  Craig Hamilton
Messages: 28
Registered: December 1996
Junior Member
Hi all:

I've been trying to use a user-defined cursor via
device,cursor_image=csr_img on an X11 Sun platform.
The scant documentation for it says the cursor image
is defined as a 16 element integer array which stores
the bits of a 16x16 bitmap.

I set it up as:
csr_img=[0,0,0,0,0,0,128,448,128,0,0,0,0,0,0,0]

This cursor is symmetric so it shouldn't matter if
each integer represents the bits in a column or
a row. The bits set in the above integers should
give a small crosshair in the center. Instead, I
get the cursor split horizontally with half of it at
the left boundary and half at the right.

Anyone worked with this and have any info?
I feel like I'm overlooking something obvious,
but have spent too much time fooling with it
already. (I'm running IDL 5.1)

Thanks,
Craig

\ Craig A. Hamilton,PhD cah@medeng.wfubmc.edu
/ The Wake Forest Univ. School of Medicine (336) 716-2819 office
\ Medical Center Blvd./MRI Center (336) 716-6890
secretary
/ Winston-Salem, NC 27157-1022 (336) 716-2870 FAX
Re: device,cursor_image ?? [message #14770 is a reply to message #14687] Wed, 24 March 1999 00:00 Go to previous message
fireman is currently offline  fireman
Messages: 49
Registered: August 1991
Member
Craig Hamilton (cah@medeng.wfubmc.edu) wrote:
: I've been trying to use a user-defined cursor via
: device,cursor_image=csr_img on an X11 Sun platform.

Craig -

I found the documentation confusing too, so once I figured it out
(v3!) I wrote a routine to translate from a bitmap to the vector. If
you blur your eyes a little you can see the cursor shape.

This shows up black; I'm not sure how to set the cursor color.

pro set_cursor

;
; SET cursor shape and hot spot
; (added per VSMR 104)
;
curs = bytarr(16,16)
curs(0,*) = [0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0]
curs(1,*) = [0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0]
curs(2,*) = [0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0]
curs(3,*) = [0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0]
curs(4,*) = [1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0]
curs(5,*) = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0]
curs(6,*) = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0]
curs(7,*) = [1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0]
curs(8,*) = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0]
curs(9,*) = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0]
curs(10,*) = [1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0]
curs(11,*) = [0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0]
curs(12,*) = [0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0]
curs(13,*) = [0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0]
curs(14,*) = [0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0]
curs(15,*) = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

power = 2^(indgen(16)) ; define power of 2 array
cursor = intarr(16) ; cursor must be integer array
for i = 0, 15 do cursor(i) = total(curs(i,*) * power)
device, cursor_image = cursor, cursor_xy = [7,7]

end


--
-- Gwyn F. Fireman
-- General Sciences Corporation / MODIS Characterization Support Team
-- Gwyn.Fireman@gsfc.nasa.gov 301-352-2118
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: statistics on large arrays
Next Topic: bug in plotting with large long integers

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

Current Time: Wed Oct 08 13:43:27 PDT 2025

Total time taken to generate the page: 0.00830 seconds