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

Home » Public Forums » archive » Onscreen digitizing
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
Onscreen digitizing [message #79559] Tue, 13 March 2012 12:19
Med Bennett is currently offline  Med Bennett
Messages: 109
Registered: April 1997
Senior Member
I have an old routine that I wrote many years ago that allows me to perform simple on-screen digitizing, and saves the resulting points in a 2 x N array. I have recently upgraded to IDL 8.1, and this routine no longer works properly. I used to just type a 'q' on the keyboard to quit digitizing and ext out of the function, but now it doesn't recognize the keyboard input. Furthermore, attempting to use this function caused IDL to become unresponsive, and I had to exit and restart IDL. I could type commands in the console and IDL would echo them, but nothing would happen. I'm probably not a good enough programmer to understand what is going wrong with this function, or know how to write a more robust version. I am wondering if you might be able to help me fix this function, or know of a working substitute that I could download. Thanks!
=======================
function scrdig,dummy ; procedure to digitize onscreen
;adapted for 24-bit color 1/20/2000

xy=fltarr(2,100)
;loadct,13

print,'Type Q to quit.'

c=0

for i=0,99 do begin

if get_kbrd(0) eq 'q' then goto, done else begin
cursor,x,y,/data,/down
xy[*,c]=[x,y]
if c eq 0 then plots,x,y,color='ff00ff'x else plots,x,y,color='ff00ff'x,/continue
print,c,x,y
c=c+1
endelse

endfor

done:
plots,xy[ 0,0],xy[1,0],color='ff00ff'x,/continue
xy=xy(*,0:c-2)
print,'polygonal area = ',poly_area(xy[0,*],xy[1,*])
xy=[[xy],[xy[*,0]]]


return,xy

end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Onscreen digitizing routine
Next Topic: Hardware graphics rendering on RedHat Linux

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

Current Time: Fri Oct 10 10:14:22 PDT 2025

Total time taken to generate the page: 0.55973 seconds