• 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 on top of QTCaptureView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing on top of QTCaptureView


  • Subject: Re: Drawing on top of QTCaptureView
  • From: Graham Cox <email@hidden>
  • Date: Sun, 3 Jan 2010 00:57:04 +1100

On 03/01/2010, at 12:42 AM, Bengt Nilsson wrote:

> B) What is the simplest object that will draw a simple line? I have found NSBox (from IB) and NSBezierPath from docs, both with lots of bells and whistles... Is there no NSLine, NSPath?


NSBezierPath. For a simple line, there is the class method +strokeLineFromPoint:toPoint: which is easy to use but may be slightly inefficient if it is creating and destroying a bezier path object internally for each call (but it may not be). There are also some utility functions such as NSRectFill() that can be used to draw orthogonal lines.

Note that the number of "bells and whistles" an object has does not necessarily translate into an inefficiency that would affect you. An object's code is fixed, it doesn't cause instances of that object to be more expensive to create just because it has a lot of methods. Don't sweat performance unless it really can be proved to be adversely affecting you.

NSBezierPath is what you do vector drawing with, if you don't want to drop down to the Core Graphics functions directly.

--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Drawing on top of QTCaptureView (From: Mike Abdullah <email@hidden>)
 >Re: Drawing on top of QTCaptureView (From: Bengt Nilsson <email@hidden>)

  • Prev by Date: Re: Drawing on top of QTCaptureView
  • Next by Date: Re: NS_INLINE and obj = nil;?
  • Previous by thread: Re: Drawing on top of QTCaptureView
  • Next by thread: Re: Drawing on top of QTCaptureView
  • Index(es):
    • Date
    • Thread