¡@

Home 

2014/10/15 ¤U¤È 10:04:43

iphone Programming Glossary: brushcontext

Save OpenGL Drawn item as a Image

http://stackoverflow.com/questions/9660723/save-opengl-drawn-item-as-a-image

file. When it's unarchived it's sent initWithCoder id initWithCoder NSCoder coder CGImageRef brushImage CGContextRef brushContext GLubyte brushData size_t width height if self super initWithCoder coder CAEAGLLayer eaglLayer CAEAGLLayer self.layer eaglLayer.opaque.. calloc width height 4 sizeof GLubyte Use the bitmatp creation function provided by the Core Graphics framework. brushContext CGBitmapContextCreate brushData width height 8 width 4 CGImageGetColorSpace brushImage kCGImageAlphaPremultipliedLast After.. kCGImageAlphaPremultipliedLast After you create the context you can draw the image to the context. CGContextDrawImage brushContext CGRectMake 0.0 0.0 CGFloat width CGFloat height brushImage You don't need the context at this point so you need to release..

Record the drawing as a m4v video file - OpenGL

http://stackoverflow.com/questions/9661259/record-the-drawing-as-a-m4v-video-file-opengl

file. When it's unarchived it's sent initWithCoder id initWithCoder NSCoder coder CGImageRef brushImage CGContextRef brushContext GLubyte brushData size_t width height if self super initWithCoder coder CAEAGLLayer eaglLayer CAEAGLLayer self.layer eaglLayer.opaque.. calloc width height 4 sizeof GLubyte Use the bitmatp creation function provided by the Core Graphics framework. brushContext CGBitmapContextCreate brushData width height 8 width 4 CGImageGetColorSpace brushImage kCGImageAlphaPremultipliedLast After.. kCGImageAlphaPremultipliedLast After you create the context you can draw the image to the context. CGContextDrawImage brushContext CGRectMake 0.0 0.0 CGFloat width CGFloat height brushImage You don't need the context at this point so you need to release..