菜鸟教程小白 发表于 2022-12-12 22:21:16

iphone - CGLayer 上的 UIImage


                                            <p><p>我想在 CGLayer 上绘制一个简单的 UIImage,但我找不到任何有用的资源来做。请告诉我如何在 CGLayer 上绘制 UIImage。</p>

<p>谢谢!</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>你要找的是这个吗?</p>

<pre><code>CGContextRef layerCtx = CGLayerGetContext(layer);
CGContextDrawImage(layerCtx, (CGRect){ CGPointZero, myImage.size }, myImage.CGImage);
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于iphone - CGLayer 上的 UIImage,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/11789073/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/11789073/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iphone - CGLayer 上的 UIImage