pptk 最近的时间轴更新
pptk

pptk

V2EX 第 392050 号会员,加入于 2019-03-14 10:59:54 +08:00
pptk 最近回复了
2020-11-17 12:05:04 +08:00
回复了 pptk 创建的主题 iOS 请问一下有人遇到过 CAGradientLayer 无法截图的问题
已解决
//绘制渐变
UIColor *firstColor = [[UIColor alloc]initWithCGColor:(CGColorRef)self.bgLayer.colors.firstObject];
UIColor *lastColor = [[UIColor alloc]initWithCGColor:(CGColorRef)self.bgLayer.colors.lastObject];
//创建一个 RGB 的颜色空间
CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();
//定义渐变颜色数组
CGFloat colors[] = {
firstColor.qmui_red, firstColor.qmui_green, firstColor.qmui_blue, 1.00,
lastColor.qmui_red, lastColor.qmui_green, lastColor.qmui_blue, 1.00
};
CGGradientRef _gradient = CGGradientCreateWithColorComponents(rgb, colors, NULL, sizeof(colors)/(sizeof(colors[0])*4));
UIGraphicsBeginImageContextWithOptions(self.preImage.size, NO, self.preImage.scale);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextInspectContext(context);
CGPoint start = CGPointMake(self.preImage.size.width/2, 0);
CGPoint end = CGPointMake(self.preImage.size.width/2, self.preImage.size.height);
CGContextDrawLinearGradient(context, _gradient, start, end, kCGGradientDrawsBeforeStartLocation);

CGImageRef imageRef = self.preImage.CGImage;
CGImageRef subImageRef = CGImageCreateWithImageInRect(imageRef,CGRectMakeWithSize(self.preImage.size));
CGContextDrawImage(context, CGRectMakeWithSize(self.preImage.size), subImageRef);

UIImage *imageOut = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
2020-08-26 12:01:50 +08:00
回复了 luckyrayyy 创建的主题 macOS MacOS 的磁盘格式这么强?复制到移动硬盘上大了好多
@luckyrayyy 已解决,直接抹掉移动硬盘,修改硬盘文件格式为 APFS 即可。
2020-08-26 11:35:10 +08:00
回复了 luckyrayyy 创建的主题 macOS MacOS 的磁盘格式这么强?复制到移动硬盘上大了好多
@luckyrayyy 我特么的拉个 xcode 进去 512G 的移动硬盘直接剩下 30G...这...
2020-08-26 09:49:44 +08:00
回复了 luckyrayyy 创建的主题 macOS MacOS 的磁盘格式这么强?复制到移动硬盘上大了好多
大哥,最后怎么解决的啊
@randyo sheetjs 可以直接打开 base64 吗?我不太会 js,整个 demo 和操作都是扒的 sheetjs 网站上的 demo 修修改搞的
@randyo 这里的 url,指的是手机本地的文件地址哈,我没有描述清楚
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3174 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 17ms · UTC 12:25 · PVG 20:25 · LAX 05:25 · JFK 08:25
Developed with CodeLauncher
♥ Do have faith in what you're doing.