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

Home » Public Forums » archive » Re: Dilating a point
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
Re: Dilating a point [message #31176] Thu, 20 June 2002 19:26
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Akhila" <idlfreak@yahoo.com> wrote in message
news:b1ad7b05.0206201342.3e9de643@posting.google.com...

> "Dick Jackson" <dick@d-jackson.com> wrote in message
> news:<i34Q8.38238$s82.3100417@news1.calgary.shaw.ca>...

>> "Akhila" <idlfreak@yahoo.com> wrote in message
>> news:b1ad7b05.0206191006.3ef24d3c@posting.google.com...

>>> I have a blank screen. Using CURSOR and PLOTS command i mark a
>>> point >>> in that screen with a value of 255B. I want to dilate
>>> that point. Can >>> anybody tell me how to do that.....Please
>>> help me.

>> How about this:
>> [direct graphics example code]

> I guess this works only for direct graphics. I need to get it
> working in Object Graphics. I used the Widget_Draw event.x and
> event.y to obtain the cursor point. I tried the 'DLgrPlot' to plot
> it, but it didn't work. Please tell me how to plot that point, in
> the current object graphics window.

(I think I've got the quoting right.)

Your original query specifically mentioned a couple of Direct Graphics
commands, leading everyone to assume you wanted a Direct Graphics
solution. How does Object Graphics come into it? Have you tried and
succeeded with DG and now want to try with OG? Or were you looking for
an OG solution all along?

Be that as it may, you will need to give more information before
anyone can help you effectively. But first, go to David Fanning's page
and check out his OG example programs. Several of these support cursor
interaction, In particular, look at his zoombox program, which uses
the cursor to mark out a box on an image and then displays the
contents of the box in a separate window. (This is probably more
elaborate than what you want.)

The basic idea is to trap your event structure in an event handler,
pass [event.x, event.y] to your window's PickData method to locate the
cursor event relative to one of the atoms in the graphics tree, then
either modify that atom or add another atom to achieve the visual
effect you want. Oh, and make sure you clean up after yourself!

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: Dilating a point [message #31179 is a reply to message #31176] Thu, 20 June 2002 17:27 Go to previous message
idlfreak is currently offline  idlfreak
Messages: 47
Registered: October 2001
Member
Hi,
I guess this works only for direct graphics. I need to get it working
in Object Graphics. I used the Widget_Draw event.x and event.y to
obtain the cursor point. I tried the 'IDLgrPlot' to plot it, but it
didn't work. Please tell me how to plot that point, in the current
object graphics window.

Thanks,
Akhila.




"Dick Jackson" <dick@d-jackson.com> wrote in message news:<i34Q8.38238$s82.3100417@news1.calgary.shaw.ca>...
> "Akhila" <idlfreak@yahoo.com> wrote in message
> news:b1ad7b05.0206191006.3ef24d3c@posting.google.com...
>> Hi,
>> I have a blank screen. Using CURSOR and PLOTS command i mark a point
>> in that screen with a value of 255B. I want to dilate that point. Can
>> anybody tell me how to do that.....Please help me.
>
> How about this:
>
> =====
>
> ;; Put one white pixel in a window
>
> Window
> Erase
> PlotS, /Device, 50, 50, PSym=3
>
> ;; Get image, dilate and redraw
>
> img = TVRD() ; Contains 0 and 255 values
> dilateImg = Dilate(img, Replicate(1, 3, 3)) ; Contains 0 and 1 values
> TV, dilateImg * 255B ; ... or TV, ([0B, 255B])[dilateImg]
>
> END
>
> =====
>
> See DILATE in online help for more details.
>
> Cheers,
Re: Dilating a point [message #31180 is a reply to message #31179] Thu, 20 June 2002 14:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Akhila (idlfreak@yahoo.com) writes:

> I guess this works only for direct graphics. I need to get it working
> in Object Graphics. I used the Widget_Draw event.x and event.y to
> obtain the cursor point. I tried the 'DLgrPlot' to plot it, but it
> didn't work. Please tell me how to plot that point, in the current
> object graphics window.

And it would help, Dick, if you could start with the
part where you get up in the morning and scratch
yourself... :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Dilating a point [message #31181 is a reply to message #31180] Thu, 20 June 2002 14:42 Go to previous message
idlfreak is currently offline  idlfreak
Messages: 47
Registered: October 2001
Member
Hi,
I guess this works only for direct graphics. I need to get it working
in Object Graphics. I used the Widget_Draw event.x and event.y to
obtain the cursor point. I tried the 'DLgrPlot' to plot it, but it
didn't work. Please tell me how to plot that point, in the current
object graphics window.

Thanks,
Akhila.

"Dick Jackson" <dick@d-jackson.com> wrote in message news:<i34Q8.38238$s82.3100417@news1.calgary.shaw.ca>...
> "Akhila" <idlfreak@yahoo.com> wrote in message
> news:b1ad7b05.0206191006.3ef24d3c@posting.google.com...
>> Hi,
>> I have a blank screen. Using CURSOR and PLOTS command i mark a point
>> in that screen with a value of 255B. I want to dilate that point. Can
>> anybody tell me how to do that.....Please help me.
>
> How about this:
>
> =====
>
> ;; Put one white pixel in a window
>
> Window
> Erase
> PlotS, /Device, 50, 50, PSym=3
>
> ;; Get image, dilate and redraw
>
> img = TVRD() ; Contains 0 and 255 values
> dilateImg = Dilate(img, Replicate(1, 3, 3)) ; Contains 0 and 1 values
> TV, dilateImg * 255B ; ... or TV, ([0B, 255B])[dilateImg]
>
> END
>
> =====
>
> See DILATE in online help for more details.
>
> Cheers,
Re: Dilating a point [message #31182 is a reply to message #31181] Thu, 20 June 2002 14:34 Go to previous message
idlfreak is currently offline  idlfreak
Messages: 47
Registered: October 2001
Member
Hi,
This works only in Direct Graphics. I forgot to mention that i've to
do this for Object Graphics. I can get the cursor point, using event.x
and event.y in the Widget_Draw events. I'm not sure how to plot that
point. I tried the 'IDLgrPlot' function, but didn't work. Please tell
me how to get this working in Object Graphics.

Thanks,
Akhila.


"Dick Jackson" <dick@d-jackson.com> wrote in message news:<i34Q8.38238$s82.3100417@news1.calgary.shaw.ca>...
> "Akhila" <idlfreak@yahoo.com> wrote in message
> news:b1ad7b05.0206191006.3ef24d3c@posting.google.com...
>> Hi,
>> I have a blank screen. Using CURSOR and PLOTS command i mark a point
>> in that screen with a value of 255B. I want to dilate that point. Can
>> anybody tell me how to do that.....Please help me.
>
> How about this:
>
> =====
>
> ;; Put one white pixel in a window
>
> Window
> Erase
> PlotS, /Device, 50, 50, PSym=3
>
> ;; Get image, dilate and redraw
>
> img = TVRD() ; Contains 0 and 255 values
> dilateImg = Dilate(img, Replicate(1, 3, 3)) ; Contains 0 and 1 values
> TV, dilateImg * 255B ; ... or TV, ([0B, 255B])[dilateImg]
>
> END
>
> =====
>
> See DILATE in online help for more details.
>
> Cheers,
Re: Dilating a point [message #31183 is a reply to message #31182] Thu, 20 June 2002 14:33 Go to previous message
idlfreak is currently offline  idlfreak
Messages: 47
Registered: October 2001
Member
Hi,
This works only in Direct Graphics. I forgot to mention that i've to
do this for Object Graphics. I can get the cursor point, using event.x
and event.y in the Widget_Draw events. I'm not sure how to plot that
point. I tried the 'IDLgrPlot' function, but didn't work. Please tell
me how to get this working in Object Graphics.

Thanks,
Akhila.


"Dick Jackson" <dick@d-jackson.com> wrote in message news:<i34Q8.38238$s82.3100417@news1.calgary.shaw.ca>...
> "Akhila" <idlfreak@yahoo.com> wrote in message
> news:b1ad7b05.0206191006.3ef24d3c@posting.google.com...
>> Hi,
>> I have a blank screen. Using CURSOR and PLOTS command i mark a point
>> in that screen with a value of 255B. I want to dilate that point. Can
>> anybody tell me how to do that.....Please help me.
>
> How about this:
>
> =====
>
> ;; Put one white pixel in a window
>
> Window
> Erase
> PlotS, /Device, 50, 50, PSym=3
>
> ;; Get image, dilate and redraw
>
> img = TVRD() ; Contains 0 and 255 values
> dilateImg = Dilate(img, Replicate(1, 3, 3)) ; Contains 0 and 1 values
> TV, dilateImg * 255B ; ... or TV, ([0B, 255B])[dilateImg]
>
> END
>
> =====
>
> See DILATE in online help for more details.
>
> Cheers,
Re: Dilating a point [message #31198 is a reply to message #31183] Wed, 19 June 2002 11:28 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
"Akhila" <idlfreak@yahoo.com> wrote in message
news:b1ad7b05.0206191006.3ef24d3c@posting.google.com...
> Hi,
> I have a blank screen. Using CURSOR and PLOTS command i mark a point
> in that screen with a value of 255B. I want to dilate that point. Can
> anybody tell me how to do that.....Please help me.

How about this:

=====

;; Put one white pixel in a window

Window
Erase
PlotS, /Device, 50, 50, PSym=3

;; Get image, dilate and redraw

img = TVRD() ; Contains 0 and 255 values
dilateImg = Dilate(img, Replicate(1, 3, 3)) ; Contains 0 and 1 values
TV, dilateImg * 255B ; ... or TV, ([0B, 255B])[dilateImg]

END

=====

See DILATE in online help for more details.

Cheers,
--
-Dick

Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Using COM objects in IDL (Win32 only)
Next Topic: Re: SOCKET and POST forms

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

Current Time: Wed Oct 08 19:14:23 PDT 2025

Total time taken to generate the page: 0.00618 seconds