A scheme to show picture

Posted by luoliyong on Stack Overflow See other posts from Stack Overflow or by luoliyong
Published on 2011-04-20T04:09:22Z Indexed on 2011/11/28 1:51 UTC
Read the original article Hit count: 153

Filed under:

I have a requirement that need me to show picture using one canvas.

All the operation will be done on this canvas, include change the picture (This picture is made of lines, rectangular and so on. Draw these lines or rectangular will use the base method).

In China, we called use double buffer(CGBitmapContextCreate), one of the scheme like this

// create the bitmap context

CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();

CGContextRef context = CGBitmapContextCreate(nil,27,27,8,0, colorSpace,kCGImageAlphaPremultipliedLast);

CFRelease(colorSpace);

Maybe now it is not very clear. I talk about the project.

The project has an engine, That will call methed draw line, draw round ,draw rectangular according user's input, this lines, rounds, rectangular will make up a picture? and then usr changes his input, the picture also will change, the engine accept usr's input, and draw picture. and the engine inits only once.

I hope you can understand what I say, and give me some advice. Thanks.

© Stack Overflow or respective owner

Related posts about cgbitmapcontextcreate