• 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
QD drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

QD drawing


  • Subject: QD drawing
  • From: Steve Mills <email@hidden>
  • Date: Tue, 12 Nov 2002 19:17:02 -0600

I have a bit of a problem I need help with. I have a NSView subclass that's contained in an NSScrollView with a horizontal scrollbar. The width of the view can be huge, because I'm displaying sound data in it. The Cocoa classes can handle the large coordinate system because they use floats.

Initially, I was drawing the wave with an NSBezierPath. But this is painfully slow when the view is "zoomed" out so the entire sound is visible within the view and the sound file is large. (And yes, I'm only drawing for every screen pixel, not every sample point.) To see if I could speed it up, I change my view to subclass from NSQuickDrawView and drew the waveform with QD's LineTo. The result was very fast drawing. But, when the view is scrolled enough and the drawing is taking place at coordinates greater than QD can handle, it obviously stops drawing.

The next thing I tried was drawing into some sort of offscreen, so I could keep the origin at 0. So I subclassed NSCustomImageRep. Cocoa drawing works in this, but QD doesn't.

So what else could I try? I need to be able to draw with QD (or maybe Quartz?) into some sort of offscreen, then plop that offscreen into my view. Perhaps, since my view is a NSQuickDrawView subclass, I could draw with QD into a GWorld, then draw that into my view. I'll go try this now, but I'd still like to hear if there is a better way to do this.

I haven't even looked at any of the Quartz headers yet. Is there something there that's faster than drawing an NSBezierPath? Faster than LineTo?

Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Hit detection on shapes within window
  • Next by Date: Re: [OT] Re: Personal picture in OS X Mail program
  • Previous by thread: current desktop picture?
  • Next by thread: [Semi Off] General Interface Speed
  • Index(es):
    • Date
    • Thread