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

Home » Public Forums » archive » clipboard objects and postscript (unix)
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
clipboard objects and postscript (unix) [message #13303] Mon, 02 November 1998 00:00 Go to next message
seanosea is currently offline  seanosea
Messages: 6
Registered: November 1998
Junior Member
Howdy, folks. I'm having difficulties with the Clipboard object in IDL on
unix. This is pretty much my first time posting anywhere; I was so impressed
by the helpfulness here that I decided to try it out.

First, IDL saves to the PostScript "native format" file with a bitmap rather
than a "true" PostScript objecty-sort of "do this, do that" structure. That
is, in a normal PS file, you'll see at some point all the words of text
actually spelt out as "{X} goright {Axis}" or whatever, whereas IDL's PS just
has 1's and 0's.

Is there a way to output a graphics tree in normal non-bitmap PS form? This,
of course, allows for much greater resolution scalability.

Second, supposing there isn't, the simplest X Window clipboard utility,
xclipboard, can't seem to latch on to my attempts to increase the resolution
and dimensions of the clipboard object. Drawing to the clipboard at the
default res of 72dpi and default dim of 640x480 works fine: xclipboard
"converts" it nicely to a PS image with bounding box 640x480, but it's too
low of res for my purposes.

When I increase the res from 72dpi, leaving the dim at the default 640x480,
IDL adjusts the dim to keep res*dim constant. So if I double the res, IDL
halves the dim, leaving the effective resolution (amount of information)
constant. Finally, if I increase both the res and the dim, IDL hangs, and
xclipboard complains "failure to convert clipboard data". When I kill
xclipboard, IDL wakes up.

Is there a way to increase the res, making the file much bigger but the image
more detailed?

I'm working on a SunOS system.

I really appreciate any thoughts.
Thanks,
Sean O'Sea

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Re: clipboard objects and postscript (unix) [message #13418 is a reply to message #13303] Wed, 04 November 1998 00:00 Go to previous messageGo to next message
mgs is currently offline  mgs
Messages: 144
Registered: March 1995
Senior Member
In article <MPG.10aa1302732fdc32989701@news.frii.com>, davidf@dfanning.com
(David Fanning) wrote:

> Stein Vidar Hagfors Haugan (steinhh@ulrik.uio.no) writes:
>
>> BTW, the trackball object is just as handy when dealing with
>> direct graphics as well as object graphics!
>
> Duh, of course it is. How come I didn't realize that!?
> I'm getting old. I'm going to leave the programming to
> the young turks and get into a new line of business. :-(
>
> Any ideas?

Politics. You can blame the people that catch your mistakes.
Mike Schienle Interactive Visuals, LLC
mgs@ivsoftware.com http://www.ivsoftware.com/
Re: clipboard objects and postscript (unix) [message #13422 is a reply to message #13303] Wed, 04 November 1998 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Stein Vidar Hagfors Haugan (steinhh@ulrik.uio.no) writes:

> BTW, the trackball object is just as handy when dealing with
> direct graphics as well as object graphics!

Duh, of course it is. How come I didn't realize that!?
I'm getting old. I'm going to leave the programming to
the young turks and get into a new line of business. :-(

Any ideas?

Cheers,

David

----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: clipboard objects and postscript (unix) [message #13424 is a reply to message #13303] Wed, 04 November 1998 00:00 Go to previous messageGo to next message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
In article <MPG.10a92a5f99bbf1609896fd@news.frii.com> davidf@dfanning.com
(David Fanning) writes:
> Sean O'Sea (seanosea@my-dejanews.com) writes:
>
>> I'm afraid the problem seems to be an unhappy xclipboard. RSI recommended
>> using the buffer object, instead, to avoid an intervening clipboard utility
>> entirely:
>>
>>> The best alternative for creating a PostScript file from Object Graphics
>>> output is to render the graphics to an IDLgrBuffer object, which will,
>>> of course contain raster data. Then, using the IMAGE_DATA keyword to the
>>> GetProperty method of the IDLgrBuffer object, you can retrieve the
>>> graphics data into an image array. Finally, you can switch to the
>>> PostScript device (SET_PLOT, 'PS') and use the TV procedure to render
>>> the extracted image array to a PostScript file.
>
> Sigh...It's come to this, has it? Well, with True-type fonts
> it just might work.

But this would mean that all lines etc are rastered, no?
And if you yank up the resolution, you get *huge* files, right?
This means (IMHO) that Object Graphics is still a nice toy,
but in practice it's useless as a tool for producing publication
quality figures on paper.

I've just decided *not* to use object graphics for some 3D
visualization I need for my thesis, since what I want is
to plot lines etc. in a 3D geometry. Now, this is fully
possible to do in direct graphics with "T3D et al", and
it comes out crisp and clear in PS files.

And I cannot really see why it should be any problem for RSI
to create an Object Graphics -> Direct Graphics "translator".

I'm having a hard time figuring out exactly *which* parts of
the OG implementation that's impossible to recreate in direct
graphics. Sure, shaded surfaces, polyfilled stuff, etc. has
to be pixelized, but those are already pixelized in todays
direct graphics implementation - but without pixelizing
the axes/labels/lines etc.

BTW, the trackball object is just as handy when dealing with
direct graphics as well as object graphics!

Stein Vidar
Re: Clipboard [message #14750 is a reply to message #13303] Thu, 25 March 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Phillip David (pdavid@earthling.net) writes:

> IDL 5.0 got rid of direct copying to the clipboard, but this was restored on
> Windoze and Mac after much user complaining. However, it is no longer linked
> to the Ctrl-G (Command-G on the Mac). Instead, it is now available using
> "Standard" copy keys -- Ctrl-C on Windows, Command-C on Mac.
>
> Check this out as well, because you might not even need David F's new routine...

I would hardly call this a "solution". It doesn't require
any programming at all! No pain, no gain, is my motto. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Clipboard [message #14762 is a reply to message #13303] Wed, 24 March 1999 00:00 Go to previous message
Phillip &amp; Suzanne is currently offline  Phillip &amp; Suzanne
Messages: 31
Registered: June 1998
Member
Kelly Dean wrote:
>
> We just purchased 50 IDL licenses from RSI which allowed us to upgrade
> many of are IDL users from IDL 3.6 to IDL 5.2. These people stuck in the
> darkages are missing two features of IDL 3.6 for Windows:
>
> 1. Copy a selected window to the clipboard
> 2. Print a selected window to the printer.
>
> I have Dave Fanning's PrintIt.pro that solves #2, but I was wondering if
> anyone has worked on a creating a simple routine to use the clipboard,
> much like PrintIt.pro.

IDL 5.0 got rid of direct copying to the clipboard, but this was restored on
Windoze and Mac after much user complaining. However, it is no longer linked
to the Ctrl-G (Command-G on the Mac). Instead, it is now available using
"Standard" copy keys -- Ctrl-C on Windows, Command-C on Mac.

Check this out as well, because you might not even need David F's new routine...

Phillip
Re: Clipboard [message #14767 is a reply to message #13303] Wed, 24 March 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Kelly Dean (krdean@lamar.colostate.edu) writes:

> We just purchased 50 IDL licenses

50! Wow. Need a class? :-)

> from RSI which allowed us to upgrade
> many of are IDL users from IDL 3.6 to IDL 5.2. These people stuck in the
> darkages are missing two features of IDL 3.6 for Windows:
>
> 1. Copy a selected window to the clipboard
> 2. Print a selected window to the printer.
>
> I have Dave Fanning's PrintIt.pro that solves #2, but I was wondering if
> anyone has worked on a creating a simple routine to use the clipboard,
> much like PrintIt.pro.

Alright, here you go. Quick and dirty. Very little testing.
Just to serve (if my other program offerings are any indication)
as "inspiration" for something a whole lot better. :-)

I use the IDL graphics "clipboard" object to
write a screen dump of the window (you tell me which one
to use or I'll use the current window) to the clipboard
of the device. It took me 10 minutes to build and I've
tested it a little bit on my Windows machine. *Very* nice,
if I don't say so myself. I can copy the contents of any
IDL graphics window to the clipboard and paste the results
into, say, Paint.

IDL> Window, 5
IDL> !P.Multi = [0, 2, 1]
IDL> LoadCT, 5
IDL> TVImage, image, /Multi
IDL> Plot, Findgen(11), Color=200
IDL> Clipboard, 5

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155

[Note: This follow-up was e-mailed to the cited author.]

************************************************************ *
PRO Clipboard, windowIndex

; This procedure copies the window identified by the
; window index number (or the current window if an index
; number is not provided) to the clipboard.

IF N_Elements(windowIndex) EQ 0 THEN windowIndex = !D.Window

; Is this a valid window?

IF windowIndex LT 0 THEN BEGIN
ok = Dialog_Message('No current window to copy. Returning...')
RETURN
ENDIF

; Catch window setting errors.

Catch, error
IF error NE 0 THEN BEGIN
Catch, /Cancel
ok = Dialog_Message('Specified window is unavailable: ' + $
StrTrim(windowIndex, 2) + '. Returning...')
WSet, thisWindow
RETURN
ENDIF

; Set active window.

thisWindow = !D.Window
WSet, windowIndex
Catch, /Cancel

; Take a snapshot of window. Pay attention to visual depth.

Device, Get_Visual_Depth=thisDepth
IF thisDepth GT 8 THEN BEGIN
snapshot = TVRD(True=1)
snapshot = Color_Quan(snapshot, 1, r, g, b)
ENDIF ELSE BEGIN
snapshot = TVRD()
TVLCT, r, g, b, /Get
ENDELSE
s = Size(snapshot, /Dimensions)

; Create an object graphics image and hierarchy.

palette = Obj_New('IDLgrPalette', r, g, b)
image = Obj_New('IDLgrImage', snapshot, Palette=palette)
model = Obj_New('IDLgrModel')
model->Add, image
thisView = Obj_New('IDLgrView', ViewPlane_Rect=[0,0,s[0],s[1]])
thisView->Add, model

; Create a clipboard

theClipboard = Obj_New('IDLgrClipboard', Color_Model=1, $
Dimensions=[s[0], s[1]], N_Colors=!D.Table_Size, $
Resolution=[1.0/!D.X_PX_CM, 1.0/!D.Y_PX_CM], $
Palette=palette)

; Copy the snapshot to the clipboard.

theClipboard->Draw, thisView

; Destroy the objects.

Obj_Destroy, palette
Obj_Destroy, model
Obj_Destroy, thisView
Obj_Destroy, theClipboard

; Restore the current window.

WSet, thisWindow
END
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Read DXF-File (Autocad 13 Format)
Next Topic: Colour maps overlaid on grey-scale (medical) images

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

Current Time: Wed Oct 08 17:12:39 PDT 2025

Total time taken to generate the page: 0.00838 seconds