I want to create a bitmap CGContext with the same color space as an existing CGContext. How can I get the color space of a CGContext?
+1
A:
You need to call CGBitmapContextGetColorSpace
to get the colour space of a given bitmap context,
but if you're talking about a general context then the question isn't well defined because CGContexts have two colour spaces: stroke and fill.
Rhythmic Fistman
2010-01-24 15:39:40
How can I get color space for stroke or fill?What I want is to create a bitmap context for offline drawing, and then draw the bitmap context to current context.And I don't use CGLayer, because I don't want to cache it.
MQ Gu
2010-01-24 16:13:39
I don't think you can. What's the worst that could happen if you don't set the colour space? p.s. Your colour space is probably DeviceRGB.
Rhythmic Fistman
2010-01-24 16:41:56
It works. Thanks you very much!
MQ Gu
2010-01-24 16:50:30