Re: cacheing in on NSImage
Re: cacheing in on NSImage
- Subject: Re: cacheing in on NSImage
- From: Ethan John <email@hidden>
- Date: Wed, 10 Mar 2004 13:14:00 -0800
Always forget to send these to the list:
You might think about creating an object, something along the lines of
"MasterImage" which would abstract away what you're talking about.
It could manage three different images: the preview image, the print
image, and the display image. It could probably manage the loading and
unloading of the print image as well.
Would make changing things later one easier.
On Mar 9, 2004, at 7:49 PM, Paul FitzGerald wrote:
Well, I think I've read all the documentation twice. But I'm just not
seeing
it.
Let me just lay out the scenario and then you can let me know if I'm
on the
right track.
Problem:
I'm manipulating several large jpeg images (1-2MB) compositing them
into a
small (300x300 pixel) preview on screen. Then I'm pushing them out to
be
printed. The on-screen interactivity is running very slow. I believe
this
slowness is being caused because the images are so big. Every ime I
have to
refresh the window because something moved or was scaled there is a
long
pause.
Desired solution:
Each of the images is being read in to an NSImage from a file. What
I'd like
to do is create a scaled down image, say 600x600, that would stay
persistent
for all my on screen display. When I go to print I want to be able to
use
the full resolution image. For printing I don't mind waiting for the
image
to be re-read from the file. Since the use will be able to scale the
image
with a slider to some non specific size relying on the cache does me
little
good.
I'm thinking that I should create a NSBitmapImageRep from the file and
size
it to 600x600 then attach it to the NSImage that I'm currently using
for
drawing. I expect on-screen drawing speed would be improved by using
this
alternate representation.
Questions:
Am I on the right track?
How can I ensure that the new NSImageRep wil be the one that is used
for my
on screen drawing?
What are the specific steps required to down sample an NSImageRep?
Thanks for any help you can provide,
Paul FitzGerald
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
ethan john
Apple Campus Representative
University of Washington
http://students.washington.edu/thaen/
206.841.4157
"I'm exactly twelve times holier than I used to be."
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.