开发者

Save sequence images to iphone

开发者_Python百科I make screen shot with iphone camera use the UIGetScreenImage()method, I want to make this images sequence to video, but the memory is limited , i think write the image data to documents maybe a good choice for me. so when capture the image use UIGetSreenImage(), start a new thread to write the image data to documents, but this will delay the thread which used to capture image.

I don't know how to deal with this issues, Would you give me some advises? any reply will appreciate.


Foremost, I'd stay away from UIGetScreenImage() if you can, at least if you plan on releasing your app to the App Store. UIGetScreenImage() is not a public API, and it's one of the most likely "forbidden" APIs that Apple would reject your app for using.

If you want a screen shot (i.e. what the user sees on the device's screen), I think the approach that you've laid out works well, but you're going to need to get a graphic representation of the UIView that contains all your other views.

All UIView code must be on the main thread, though. You can do your file I/O on the background thread, but the actual getting of the image will have to be main thread.


How about NSOperationQueue?

Whenever the screen is captured and an image is created, an NSOperation which writes an image into documents is added a NSOperationQueue.

And I think you should find the best number of the max concurrent operation count (NSOperation's setMaxConcurrentOperationCount).

The max concurrent operation count depends on your app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜