Re: Drawing on top of QTCaptureView
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