Re: Creating and Displaying an Image
Re: Creating and Displaying an Image
- Subject: Re: Creating and Displaying an Image
- From: Brian Webster <email@hidden>
- Date: Mon, 30 Jul 2001 00:31:46 -0500
Hi all,
I am trying to write a program that can create an image by simply
plotting pixel by pixel on my screen (or off-screen) and then
being able
to display it on screen. I would ultimately like to see something like:
[Object setPixelx:20 y:30 color:blue];
[Object Display];
I had a look at NSImage but it seems that this class is for displaying
images that are already created and is not really used for
drawing pixels
to a graphics port.
If you're looking to manipulate images at the pixel level,
you'll probably want to look at NSBitmapImageRep. You can
create one, access its bitmap data, and write to the data, and
then use the draw, drawAtPoint:, or drawInRect: methods
(inherited from NSImageRep) to display it in a view onscreen.
--
Brian Webster
email@hidden
http://www.owlnet.rice.edu/~bwebster