unsupported parameter combination 解决办法

colorSpace = CGColorSpaceCreateDeviceRGB();

//    CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst;

//    CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst;

    

    //error

    CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Little | kCGImageAlphaNone;



http://lists.apple.com/archives/carbon-dev/2007/Jun/msg00014.html

CGBitmapContextCreate: unsupported parameter combination: set CGBITMAP_CONTEXT_LOG_ERRORS environmental variable to see the details


I am trying to use CGBitmapContextCreate to create a context for a raw
image, but I get this error message:

CGBitmapContextCreate: unsupported parameter combination: 8 integer
bits/component; 32 bits/pixel; 3-component colorspace;
kCGImageAlphaFirst.

Here is how I create my color space

...

FContext := CGBitmapContextCreate(FBits,
 NewWidth, NewHeight, 8, Stride, FColorSpace, kCGImageAlphaFirst or
kCGBitmapByteOrder32Little);

...

Any ideas about what is wrong? i looked at CGBitmapContextCreate's
docs here, but they say that it supports 32-bits images with 8 bits
per channel:

http://developer.apple.com/documentation/GraphicsImaging/Reference/ CGImage/Reference/reference.html#//apple_ref/doc/c_ref/CGBitmapInfo

That just lists possible values for CGBitmapInfo. You should check out <http://developer.apple.com/qa/qa2001/qa1037.html>. It lists the only legal combinations of bitsPerComponent, colorspace and bitmapInfo that CGBitmapContextCreate supports. It is a fairly limited set and any other combinations cause CGBitmapContextCreate to fail.


steve

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


 
 
References: 
 >Re: Unsupported format for CGBitmapContextCreate (From: "Felipe Monteiro de Carvalho" <email@hidden>)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值