gpt4 book ai didi

ios - CGBitmapContextCreate : unsupported parameter combination: 8 integer bits/component iOS

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:51:52 33 4
gpt4 key购买 nike

<分区>

我在创建上下文时遇到问题..

我看到了很多答案,但没有一个对我有用。

我有以下代码。

CGSize pixelSize = src_img.size;
pixelSize.width = src_img.scale* src_img.size.width;
pixelSize.height = src_img.scale*src_img.size.height;

size_t d_bytesPerRow = pixelSize.width * 4;
unsigned char *imgData = (unsigned char*)malloc(pixelSize.height * d_bytesPerRow);
CGImageRef imageRef = src_img.CGImage;

CGContextRef context = CGBitmapContextCreate(imgData,
(size_t)pixelSize.width, (size_t)pixelSize.height, 8, d_bytesPerRow,
CGImageGetColorSpace(imageRef), kCGImageAlphaNone);

在控制台中显示错误

CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 24 bits/pixel; 3-component color space; kCGImageAlphaNone; 1754 bytes/row.

我不知道该怎么办。请帮忙

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