Re: My screensaver vs. Aqua Icons
Re: My screensaver vs. Aqua Icons
- Subject: Re: My screensaver vs. Aqua Icons
- From: David Remahl <email@hidden>
- Date: Sat, 13 Apr 2002 09:58:41 +0200
>
Thanks everyone for the advice on how to load images into a
>
screensaver. Now I'm trying to make the images move, and am doing
>
the obvious in animateOneFrame:
>
>
[myImageView setFrame:NSOffsetRect([myImageView frame],1,1)];
>
>
The image moves, and the quality is acceptable, but there's a twinge
>
of flickering about it -- it's not nearly as smooth as the Aqua Icons
>
screensaver.
>
>
Any ideas as to how I can remedy this? I'm assuming that, as with
>
most things that I've been doing, lately, that this is a limitation
>
in my knowledge rather than a problem with Cocoa.
Absolutely. ;-)
Your best bet is to let go of the image view and do the drawing yourself.
You should have a look at the documentation for NSImage. There are a lot of
compositioning modes etc. You would then place that drawing code in your
drawRect:... method and from the animateOneFrame:... method call [self
setNeedsDisplay[InRect:]... That should allow you to get a lot better
performance, I think. Take a look at
http://ittpoi.com/sno.html for a
program and a screen saver that works this way. It is open source so you
can investigate how it is done.
If that performance is not enough for you, then you will have to do what
Aqua Icons does. Aqua Icons uses OpenGL drawing instead of Quartz and that
gives it execllent performance. There are Cocoa classes for dealing with
OpenGL as well.
>
In an air of experimentation I did override the backingStoreType; I
>
got interesting displays with NSBackingStoreRetained and
>
NSBackingStoreNonretained -- the screen alternated between
>
myImageView on a black background and a completely white screen --
>
obviously not what I was hoping for.
Experimentation is good, but I don't think you'll want to change that.
>
TIA as usual,
>
>
Michael
/ david remahl
_______________________________________________
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.