Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating and Displaying an Image



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




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.