• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: drawing pixels in NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: drawing pixels in NSView


  • Subject: Re: drawing pixels in NSView
  • From: Guillaume Borios <email@hidden>
  • Date: Mon, 26 Nov 2001 23:48:13 +0100

Why not calculating the missed points yourself? you simply have to draw all rectangles in the line from the last pixel to the previous one. To avoid continuous drawing, check the interval time between the 2 last points and don't draw if it is longer than what you think reasonable....

That was just an idea... Hope this helps.

-Gyom

Le lundi 26 novembre 2001, ` 07:47 PM, Carsten Koehler a icrit :

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
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >drawing pixels in NSView (From: Carsten Koehler <email@hidden>)

  • Prev by Date: Launching as Root
  • Next by Date: Re: LayoutManager
  • Previous by thread: drawing pixels in NSView
  • Next by thread: Re: drawing pixels in NSView
  • Index(es):
    • Date
    • Thread