Hey all,
I seem to be having a pretty weird problem with my Mac quartz graphics project. So basically I have a cgContext initialized like this:
... which should initialize a RGB-context with a generic RGB color profile and then make it white. Initializing the cgContext seems to work, and I can draw it to the screen from my custom NSView drawrect, but I can't seem to be able to modify the contents of that cgContext. No matter what I do, it stays black
Fillrect doesn't work, drawing to it with CGContextDrawLayerAtPoint doesn't work etc.
I've wasted enough time with this bugger already so I thought that I'd ask if anyone else had a clue what might be going on.
Thanks!
I seem to be having a pretty weird problem with my Mac quartz graphics project. So basically I have a cgContext initialized like this:
Code:
canvasContext = CGBitmapContextCreate(NULL,
dim.width,
dim.height,
8,
0,
CGColorSpaceCreateWithName( kCGColorSpaceGenericRGB),
kCGImageAlphaNoneSkipLast
);
CGContextSetBlendMode(canvasContext, kCGBlendModeNormal); // possibly irrelevant?
CGContextSetRGBFillColor(canvasContext, 1.0, 1.0, 1.0, 1.0);
CGContextFillRect( canvasContext, CGRectMake(0,0,dim.width, dim.height) );
... which should initialize a RGB-context with a generic RGB color profile and then make it white. Initializing the cgContext seems to work, and I can draw it to the screen from my custom NSView drawrect, but I can't seem to be able to modify the contents of that cgContext. No matter what I do, it stays black
I've wasted enough time with this bugger already so I thought that I'd ask if anyone else had a clue what might be going on.
Thanks!
Last edited: