I wish I would find an answer for this. I have searched and searched and couldn't the right answer. Here is my situation:
In a Mac OS Cocoa Application, I want to draw a pixel (actually a few pixels) onto a dedicated area on my application window. I figured, it would be nicer to have a NSImageView
placed there (I did so with IB and connected the outlet to my app delegate) and draw on that instead of my NSWindow
.
How in the world can I do that? Mac OS seems to offer NSBezierPath
as the most basic drawing tool — is that true? This is completely shocking to me. I come from a long history of Windows programming and drawing a pixel onto a canvas is the most simple thing, typically.
I do not want to use OpenGL and I am not sure to what extent Quartz is involved in this.
All I want is some help on how I can pull off this pseudocode in real Objective-C/Cocoa:
imageObj.drawPixel(10,10,blackColor);
I would love to hear your answers on this and I am sure this will help a lot of people starting with Cocoa.
Thanks!