小编Egi*_*gil的帖子

CoreGraphics中的透明背景

我试图在CG中获得透明背景,但它一直是黑色的.

我有以下代码:

- (id)initWithFrame:(CGRect)frame {
    if ((self = [super initWithFrame:frame])) {
        DLog(@">>> Alloc: DrawingCanvas [0x%X]", (unsigned int)self);
        [self setOpaque:NO];
        [self setBackgroundColor:[UIColor clearColor]];
    }
    return self;
}

- (void) drawRect:(CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGRect frame = rect;
    int counter = 3;

    CGContextClearRect(context, frame);
    CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
    CGContextFillRect(context, frame);
}
Run Code Online (Sandbox Code Playgroud)

如何让此代码显示透明背景?

iphone core-graphics

11
推荐指数
1
解决办法
5820
查看次数

适用于iOS的核心视频示例

核心视频编程指南,有没有人知道使用核心视频的任何教程和示例?

video core-video ios4

9
推荐指数
1
解决办法
3892
查看次数

标签 统计

core-graphics ×1

core-video ×1

ios4 ×1

iphone ×1

video ×1