相框 - iPhone [英] Picture frames - iPhone

查看:200
本文介绍了相框 - iPhone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要能拍摄照片(相机或图书馆),并在其上叠加类似相框,然后将其保存回相机胶卷。我应该研究OpenGL吗?或者什么?

I'd like to be able to take a picture (camera or library) and overlay something like a picture frame on it, then save it back to the camera roll. Should I be looking into OpenGL?or, what?

感谢指针。

推荐答案

除了Quartz,你不需要任何东西。查看 CGBitmapContext CGContext CGImage UIImage 。还有一个功能可以在相册中存储图片: UIImageWriteToSavedPhotosAlbum

You don't need anything except Quartz for that. Look into CGBitmapContext, CGContext, CGImage, UIImage. There's also a function to store images in the album: UIImageWriteToSavedPhotosAlbum



The way to go is:


  1. UIImagePickerController 获取 UIImage
  2. 使用 CGBitmapContextCreate 创建上下文。
  3. 在此上下文中绘制图像: CGContextDrawImage

  4. 在任何你想要的地方绘制

  5. 使用 CGBitmapContextCreateImage 从上下文创建CGImage

  6. 使用 [UIImage imageWithCGImage:] c> UIImage

  7. 使用 UIImageWriteToSavedPhotosAlbum 保存增强图片。

  1. Get a UIImage from UIImagePickerController.
  2. Build a context using CGBitmapContextCreate
  3. Draw the image in this context: CGContextDrawImage
  4. Draw whatever you want on top of that
  5. Use CGBitmapContextCreateImage to create a CGImage from the context
  6. Use [UIImage imageWithCGImage:] to get a UIImage from the CGImage
  7. Use UIImageWriteToSavedPhotosAlbum to save the augmented image.

这篇关于相框 - iPhone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆