drawing pixels in NSView
drawing pixels in NSView
- Subject: drawing pixels in NSView
- From: Carsten Koehler <email@hidden>
- Date: Mon, 26 Nov 2001 19:47:55 +0100
Hi all,
I'm trying to create an application where I can draw 'big' pixels on a
NSView. (Just like an Icon Editor)
What I'm doing is to get the mouse position, calculate a rectangle,
append it to an NSBezierPath and redraw the NSView.
Basically it's working the only problem is, that it doesn't respond to
my drawing quite well. If I move the mouse very slowly, it draws every
dot. But if I move the mouse faster, the distance between the dots get
bigger and bigger.
I tried to speed the application up and gave the NSView the first
responder, repain the NSView in the rect that changed only , and still
it's too slow.
Two questions:
Is there a possibility to make the NSView more responsive?
Is there a better way of painting an image with 'big' pixels? Maybe with
a BitmapRep?
Any ideas? Or some source code sample?
Thanks for your help
Carsten