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

Home » Public Forums » archive » point on an 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
point on an image() [message #92209] Thu, 29 October 2015 09:37
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
Hi,
I would like to display some points (pixels) on an image in FG.
Here is an example of what I'm doing (and I'm not happy with this):

oImg = image(dist(400),margin=0)
pts = randomu(s,100,100) gt 0.5
emptyImage = bytarr(400,400)
ovImg = emptyImage
ovImg[150:249,150:249] = pts * 255b
tImage = [[[ovImg]],[[emptyImage]],[[emptyImage]],[[ovImg]]]
oImgOverlay = image(tImage, overplot=oImg, transparency=50)

This way a red set of points is drawn on the original image. However, I have no bounding box and I can't, for instance, click on the original image.

Is there a way to do this either using plot()(1) or polyline()(2)?

It would save me quite some trouble. So far I ran against FG walls...

Thanks,
Helder

(1) I've tried plot() and I got something using these lines:

locs = where(ovImg)
coordinates = array_indices([400,400], locs, /dimens)
oPlot = plot(coordinates[0,*],coordinates[1,*],'. ', overplot=oImg, transparency=50)

But using the dot does not look as good as using the pixels. Specially when you zoom in.

(2) Polyline does not allow plotting symbols.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Feature request: extend the getValueAtLocation method to Polyline() and Polygon()
Next Topic: Finding strings values common to two (large!) arrays

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

Current Time: Wed Oct 08 07:15:19 PDT 2025

Total time taken to generate the page: 0.00383 seconds