开发者

Draw over a video in an iphone application

开发者 https://www.devze.com 2023-04-07 11:55 出处:网络
I am looking for a method so that i can make an iphone application which plays video and the user be able to draw over the video that is being played..

I am looking for a method so that i can make an iphone application which plays video and the user be able to draw over the video that is being played..

I would r开发者_运维百科eally appreciate it if some one could share some information on this regard..


In the simplest case, you could just put a UIView with a transparent background on top of the video being played.

If you want to merge/flatten the images, it gets a bit more complicated. Can you go into more detail on exactly what you're trying to do?


Hey there so yes putting a UIVIew over the video is going to be your best bet and then use quartz2d for drawing over it. And then lets say you would like to take a screen shot go ahead and use this code.

UIGraphicsBeginImageContext(self.bounds.size);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

There you are! Oh and if you wanna say put an image or a UIIMageView over the video. Its not different at all. Just add the UIImageView to the UIView thats over the video:) Enjoi!

0

精彩评论

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

关注公众号