gpt4 book ai didi

cocoa - 与[CIContext绘制图像:…]

转载 作者:行者123 更新时间:2023-12-03 17:27:09 25 4
gpt4 key购买 nike

最后两行有什么区别?

    CIImage *outputImage = [compositingFilter valueForKey:@"outputImage"];


[[[NSGraphicsContext currentContext] CIContext] drawImage:outputImage atPoint:point fromRect:fromRect];

[outputImage drawAtPoint:point fromRect:fromRect operation:op fraction:delta];

最后一个生成一个扭曲的图像,其矩形小于[outputImage范围];

drawImage: 线在某些情况下会崩溃。

最佳答案

来自 -drawAtPoint 的文档:...

The image content is drawn at its current resolution and is not scaled unless the CTM of the current coordinate system itself contains a scaling factor. The image is otherwise positioned and oriented using the current coordinate system.

如果您想要绘制整个图像,fromRect 应该是图像的整个大小。此外,在许多情况下,不同绘图方法之间的翻转处理方式也不同。

最后,-drawImage 上的文档:...有些神秘地仅说明:

You can call this method to force evaluation of the result after you apply a filter using one of the methods of the CIFilter class, such as apply:, apply:arguments:options:, and apply:k…

希望这有帮助。

关于cocoa - 与[CIContext绘制图像:…],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1411754/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com