Re: Widget_Draw - Help [message #27328] |
Fri, 19 October 2001 08:04 |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
> Logan Lindquist wrote:
>
> I figured I would start with something easy, trying to create widget
> that displays images in Widget_Draw. I am trying to pass the wdraw
> variable in a Struct to the button procedure event handler. The event
> handler then calls a procedure that will hopefully open the file,
> resize the image and display in the wdraw window. Right now I am
> getting an error saying that my wdraw variable is undefined. Some
> hints to what I am doing wrong, would be greatly appreciated!
In addition to the helpful suggestions you have already received, you
may wish to examine the IMGUI example program that is described in my
book. It is designed to display a Pseudo or True color image in a
resizeable direct graphics draw widget. The source code can be obtained
as part of the "Sample Programs" packages at
http://www.gumley.com/PIP/About_Book.html
IMGUI uses IMDISP for displaying images.
Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
|
|
|
Re: Widget_Draw - Help [message #27329 is a reply to message #27328] |
Fri, 19 October 2001 07:31  |
Logan Lindquist
Messages: 50 Registered: October 2001
|
Member |
|
|
Pavel,
Thanks for the URL's. I already had tvimage and was aware of Mr. Fanning's
site, but I did not know where I would find IMDISP. I still have other
functionality that I need to add here in a week or so. After then I would
have more time to fine tune things and see how well IMDISP works.
Thanks Again,
Logan
|
|
|
|
Re: Widget_Draw - Help [message #27335 is a reply to message #27332] |
Thu, 18 October 2001 20:22  |
Logan Lindquist
Messages: 50 Registered: October 2001
|
Member |
|
|
David,
> Well, TVIMAGE or IMDISP or PLOTIMAGE will sort
> those color problems out for you without you
> having to lift a finger. :-)
I removed some code that I had borrowed from dialog_read_image that was
doing some funky color adjustments, slapped in a 'tvimage, image,
/KEEP_ASPECT_RATIO' and it works beautifully! I'll have to look at those
other two you mentioned.
Thanks for all the help.
Logan
|
|
|
Re: Widget_Draw - Help [message #27336 is a reply to message #27335] |
Thu, 18 October 2001 18:47  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Logan Lindquist (llindqusit@mrdoc.cc) writes:
> You got it! That was exactly the problem. At least I am over that hurdle. I
> seem to be having color channel issues now but with a little work, I think
> I'll figure it out.
Well, TVIMAGE or IMDISP or PLOTIMAGE will sort
those color problems out for you without you
having to lift a finger. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
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: Widget_Draw - Help [message #27337 is a reply to message #27336] |
Thu, 18 October 2001 18:06  |
Logan Lindquist
Messages: 50 Registered: October 2001
|
Member |
|
|
David,
You got it! That was exactly the problem. At least I am over that hurdle. I
seem to be having color channel issues now but with a little work, I think
I'll figure it out.
Thanks,
Logan
|
|
|
Re: Widget_Draw - Help [message #27338 is a reply to message #27337] |
Thu, 18 October 2001 14:14  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Logan Lindquist (llindqusit@mrdoc.cc) writes:
> I figured I would start with something easy, trying to create widget
> that displays images in Widget_Draw. I am trying to pass the wdraw
> variable in a Struct to the button procedure event handler. The
> event handler then calls a procedure that will hopefully open the
> file, resize the image and display in the wdraw window. Right now
> I am getting an error saying that my wdraw variable is undefined.
> Some hints to what I am doing wrong, would be greatly appreciated!
Well, let's see. Where to begin? :-)
I guess your basic problem is that you created
an object graphics draw widget:
> wdraw = Widget_Draw(wbase_col, XSize=256, YSize=256,$
> Graphics_Level=2, Expose_Events=1, Retain=0, $
> Event_Func ='image_expose')
and I think you wanted to create a direct graphics draw
widget. You will want to leave out the Graphics_Level
keyword.
The value of a direct graphics draw widget is the
draw widget's window index number. The value of
an object graphics draw widget is a window object.
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
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
|
|
|