Re: Pixel level drawing in Cocoa
Re: Pixel level drawing in Cocoa
- Subject: Re: Pixel level drawing in Cocoa
- From: Gerard Iglesias <email@hidden>
- Date: Wed, 11 Dec 2002 22:18:08 +0100
Did you try to use :
unsigned int bytesPerRow = (itsSize.width * 8 * 4 + 7)/8;
unsigned char * data = NSZoneMalloc([self zone], itsSize.height *
bytesPerRow);
itsContext = CGBitmapContextCreate(data, itsSize.width,
itsSize.height, 8, bytesPerRow, CGColorSpaceCreateDeviceRGB(),
kCGImageAlphaPremultipliedLast);
It builds a CoreGraphics context that you can use with CG functions
Gerard
On Wednesday, December 11, 2002, at 08:18 PM, <email@hidden>
wrote:
>
Hi,
>
>
What's the best APIs to use if I would like to do pixel level drawing
>
in Cocoa
>
but would later like to manipulate my image with Quartz functions? I'm
>
considering using a NSBitmapImageRep but I'm hoping there's something
>
simpler
>
I've overlooked.
>
>
Thanks
>
~Hua ying
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.