cacheing in on NSImage
cacheing in on NSImage
- Subject: cacheing in on NSImage
- From: Paul FitzGerald <email@hidden>
- Date: Tue, 09 Mar 2004 19:49:25 -0800
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.