Re: Sending an image to Preview to preview the image
Re: Sending an image to Preview to preview the image
- Subject: Re: Sending an image to Preview to preview the image
- From: Ricky Sharp <email@hidden>
- Date: Tue, 6 May 2008 17:50:21 -0500
On May 6, 2008, at 5:40 PM, Bill wrote:
On May 6, 2008, at 3:31 PM, Michael Watson wrote:
Thoughts:
1. Why not build your own preview panel/window? It's remarkably
easy to do if you already have the image data in an NSData object.
True, but preview has other advantages, such as saving the file to
various formats. Sure I could do all that, but since that
functionality already exists in Preview....
2. If you must use Preview, you could write the image to a temp
file and tell Preview to open that via NSWorkspace's -
openFile:withApplication: method.
I tried that also, but then there is that temp file that could end
up in the Recovered Items folder in the Trash. That method also
exposes the temp folder in Preview (which is probably not a big
deal, but it looks odd).
My app currently does this as well for PDF files. While I could (and
may still) put in all the code to directly print, I felt it was a nice
stepping stone to rely on Preview.
But, yes, the temp folder gets a bit clunky especially when users do a
Save As... (they start in the temp folder in the NSSavePanel).
For another feature of the app (which also generates PDF), I changed
the workflow to first run an NSSavePanel to let the user specify file
name and location. I then generate the PDF at that location and
launch Preview to open it. I'm not sure if this workflow works for
you though since you probably want more of a "throw away" preview.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden