# demonstrates how das2 findRendererAt locates the renderer at each pixel position.

app= getApplication()
canvas= dom.controller.canvas
w= canvas.width
h= canvas.height

if ( canvas.fitted==False ): print "canvas must be fitted"

dasPlot= dom.controller.plot.controller.dasPlot

rendAt= zeros( w, h )

monitor.setTaskSize(w)
monitor.started()

for i in range(w):
   monitor.setTaskProgress(i)
   if monitor.cancelled: break
   for j in range(h):
      rendAt[i,h-j-1]= dasPlot.findRendererAt(i,j)

n= newApplication('rendAt')
setApplication(n)
plot( rendAt )
setApplication(app)


