Hi guys,
I am banging my head in the wall in the last few days, trying to figure out this stuff. Apple documentation, as always, is vague and disperse as hell, so, it is impossible to understand that without losing the sanity. I hope you guys, supreme gurus, can help me solving this puzzle.
Here is my problem. I have a CGLayer containing a high resolution image and a UIImageView proxy object representing that layer on the screen, containing a low resolution version of the same image of the CGLayer. This proxy object is seen on the screen and the user can pinch zoom, scale and translate it. Every transformation done to the proxy object is applied to the CGLayer, as this layer will be used to render offscreen later.
Now comes the part where it is time to render offscreen.
When the application started, both the CGLayer and the proxy object were rendered on the center of the screen. But now the proxy and the CGLayer objects were scaled, zoomed and translated and have different angles, sizes and coordinates. When the CGLayer was first drawn, I used the code
but now the CGLayer is transformed and I do not have a layerRect anymore.
I thought about using CGContextDrawAtPoint, but I do not have a center coordinate to write the layer, I mean, what would be the center point to write a layer that was transformed like hell?
Can you guys show me a code where a CGLayer is pinched transformed (zoom, translation and rotation) and drawn in another position?
Please be as detailed as possible, as my knowledge of Quartz is very basic. I think the creators of Quartz were hating the world when they create that stuff. For God's sake!
thanks for any help.
I am banging my head in the wall in the last few days, trying to figure out this stuff. Apple documentation, as always, is vague and disperse as hell, so, it is impossible to understand that without losing the sanity. I hope you guys, supreme gurus, can help me solving this puzzle.
Here is my problem. I have a CGLayer containing a high resolution image and a UIImageView proxy object representing that layer on the screen, containing a low resolution version of the same image of the CGLayer. This proxy object is seen on the screen and the user can pinch zoom, scale and translate it. Every transformation done to the proxy object is applied to the CGLayer, as this layer will be used to render offscreen later.
Now comes the part where it is time to render offscreen.
When the application started, both the CGLayer and the proxy object were rendered on the center of the screen. But now the proxy and the CGLayer objects were scaled, zoomed and translated and have different angles, sizes and coordinates. When the CGLayer was first drawn, I used the code
Code:
CGContextDrawImage(layerContext, layerRect, myImage.CGImage);
but now the CGLayer is transformed and I do not have a layerRect anymore.
I thought about using CGContextDrawAtPoint, but I do not have a center coordinate to write the layer, I mean, what would be the center point to write a layer that was transformed like hell?
Can you guys show me a code where a CGLayer is pinched transformed (zoom, translation and rotation) and drawn in another position?
Please be as detailed as possible, as my knowledge of Quartz is very basic. I think the creators of Quartz were hating the world when they create that stuff. For God's sake!
thanks for any help.