Mac OS X 上的浮动图片屏幕保护程序
我刚刚学习使用 XCode 和 Objective-C 编程(我的计划是编写一个我们业务所需的应用程序,因为我找不到一个可以满足我需要的应用程序)。进展顺利,作为一项练习,我一直在使用数据库应用程序和屏幕保护程序。
我正在尝试编写一个屏幕保护程序,它所做的只是显示 3 或 4 张随机浮动在屏幕上的图片。类似于 Mac OS X 附带的开箱即用的图片屏幕保护程序。
我玩过 http://cocoadevcentral.com/articles/000088.php 中的代码虽然信息非常丰富,但我仍然不知道如何添加这 3 或 4 张图片并使它们动起来。
有人可以指点我示例代码吗?或者有一个项目可以作为参考吗?
再次强调,这只是自学。
谢谢你!
I'm just learning to use XCode and program in Objective-C (my plan is to write a an app we need for my business since I can't find one that does what I need). It's going well and as an exercise I've been playing with database apps and screensavers.
I'm trying to write a screensaver that all it does is to show 3 or 4 pictures randomly floating on the screen. Similar to the out of the box pictures screensaver that comes with Mac OS X.
I've played with the code in http://cocoadevcentral.com/articles/000088.php and while very informative I still don't know how to add those 3 or 4 pictures and make them move.
Anyone out there can point me to sample code? Or a project that I can use as reference?
Again, this is just self learning.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能是您的第一个停靠港。
This will probably be your first port of call.
我的方法是使用 Quartz Composer 创建 Quartz Composition。我发现这比弄清楚如何手动绘制所有内容并为其设置动画更容易。
您可以使用 QCView 类在 ScreensaverView 内显示石英合成物。这个设置对我来说效果很好。
My approach to this was to create a Quartz Composition using Quartz composer. I found this easier than figuring out how to draw and animate everything by hand.
You can display a quartz composition inside a ScreensaverView by using the QCView class. This setup worked well for me.