gpt4 book ai didi

objective-c - NSImage 绘制矩形 :fromRect:operation:fraction results in a flipped image

转载 作者:太空狗 更新时间:2023-10-30 04:01:14 33 4
gpt4 key购买 nike

当我使用时:

[iconImage drawInRect:NSMakeRect(cellFrame.origin.x+5,yOffset+3,cellFrame.size.height-6, cellFrame.size.height-6)
fromRect:NSMakeRect(0,0,[iconImage size].width, [iconImage size].height)
operation:NSCompositeSourceOver
fraction:1.0];

要在 NSOutlineView 单元格中绘制一些图像,图像会垂直上下颠倒。我该如何解决?

谢谢

最佳答案

使用方法

- (void)drawInRect:(NSRect)dstSpacePortionRect
fromRect:(NSRect)srcSpacePortionRect
operation:(NSCompositingOperation)op
fraction:(CGFloat)requestedAlpha
respectFlipped:(BOOL)respectContextIsFlipped
hints:(NSDictionary *)hints

连同 - (void)lockFocusFlipped:(BOOL)flipped

将图像倒过来绘制。来自NSImage Reference手册。

关于objective-c - NSImage 绘制矩形 :fromRect:operation:fraction results in a flipped image,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10687757/

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