CGImage (or UIImage) from a CALayer

后端 未结 2 1647
迷失自我
迷失自我 2021-02-09 23:37

I have created a CALayer (I added several shapes to the layer, but ultimately, I have a single CALayer), and I am having a LOT of trouble adding it to a CGImage.

2条回答
  •  粉色の甜心
    2021-02-10 00:10

    Create a bitmap graphics context and use renderInContext: to draw the layer into it. You now have the layer in an image.

提交回复
热议问题