On Friday, November 22, 2013 3:33:16 PM UTC+1, David Fanning wrote:
> Helder writes:
>
>
>
>> I would like to place markers on an Image(). Unfortunately, normally the cursor looks like an arrow on the function graphic images. I would like to modify its appearance to something like a crosshair (that is the standard in direct graphics). I could not find something for object graphics that resembles the command
>
>> device, /crosshair
>
>> Anyone knows if this is possible?
>
>
>
> Try REGISTER_CURSOR.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Hi David,
thank as usual for the suggestion. In the meanwhile I was on a train and I looked more into the problem. The thing is that if I draw an object (a cross) on an object (an image), the mouse changes to all the possible shapes (to change size and position). This was pretty annoying. So I found a way around this and instead of drawing a cross, I'm now drawing a circle with 4 lines pointing to the center without reaching it. This way I get the crosshair pointer and don't get close enough to the object to get annoyed by changes in cursor.
For completeness, here is how I draw this positioning object (the coordinates part is a bit confusing, but I don't want to post the even more confusing rest of the code!)
DevCoords = (*self.win1).ConvertCoord([self.Coords[0],self.Coords[2]], [self.Coords[1], self.Coords[3]], /DATA, /TO_DEVICE)
*self.cObj1[0] = POLYLINE([DevCoords[0,I]-self.dCross, DevCoords[0,I]-(self.dCross/2)], [DevCoords[1,I], DevCoords[1,I]], '-r2', TARGET=(*self.win1), /DEVICE)
*self.cObj1[1] = POLYLINE([DevCoords[0,I]+self.dCross, DevCoords[0,I]+(self.dCross/2)], [DevCoords[1,I], DevCoords[1,I]], '-r2', TARGET=(*self.win1), /DEVICE)
*self.cObj1[2] = POLYLINE([DevCoords[0,I], DevCoords[0,I]], [DevCoords[1,I]-self.dCross, DevCoords[1,I]-(self.dCross/2)], '-r2', TARGET=(*self.win1), /DEVICE)
*self.cObj1[3] = POLYLINE([DevCoords[0,I], DevCoords[0,I]], [DevCoords[1,I]+self.dCross, DevCoords[1,I]+(self.dCross/2)], '-r2', TARGET=(*self.win1), /DEVICE)
*self.eObj1 = ELLIPSE(DevCoords[0,I], DevCoords[1,I], MAJOR=self.dCross, '-r2', TARGET=(*self.win1), /DEVICE, FILL_BACKGROUND=0)
Cheers,
Helder
|