Am 02.04.2008 um 01:05 schrieb Graham Cox:
As I said, it says nothing about how it's implemented. Chances are,
it will avoid creation of an unnecessary NSBezierPath object, but
relying on that being the case is folly.
On 2 Apr 2008, at 2:23 am, Matthew Whillock wrote:
The class reference
Hi Graham,
Yes, you're right. Moments after I sent my email I found the right
tree to bark up.
Cheers,
Matt
On 2 Apr 2008, at 00:05, Graham Cox wrote:
As I said, it says nothing about how it's implemented. Chances are,
it will avoid creation of an unnecessary NSBezierPath object, but
re
As I said, it says nothing about how it's implemented. Chances are, it
will avoid creation of an unnecessary NSBezierPath object, but relying
on that being the case is folly.
On 2 Apr 2008, at 2:23 am, Matthew Whillock wrote:
The class reference has this to say about it:
Strokes a line bet
p1 = [NSBezierPath bezierPath] ;
[p1 moveToPoint: linebottom] ;
[p1 lineToPoint: linetop] ; [p1 stroke] ;
You could keep a permanent bezier path at a convenient location (e.g.
your view) and empty it instead of releasing it. This worked fine for
my app:
[localPath re
The class reference has this to say about it:
Strokes a line between two points using the current stroke color and
the default drawing attributes.
+ (void)strokeLineFromPoint:(NSPoint)point1 toPoint:(NSPoint)point2
So it will just draw a line.
Cheers,
Matt
Are you sure? This could be jus
Yes, I am. The doc says nothing but according to the assembly form of
this method, it do something like this:
CGContextBeginPath()
CGContextMoveToPoint()
CGContextAddLineToPoint()
CGContextStrokePath()
Most of NSBezier method are just simple wrappers upon CoreGraphics
equivalent.
An oth
Hi Leslie,
NSView does not store any drawing. If the code bellow
is
executed in the loop as you are indicating and
possibly several thousand times, each time through the
loop you are creating a new autoreleased NSBezierPath.
If this is the case, you should include
NSAutoreleasePool and drain or fr
On 1 Apr 2008, at 11:40 pm, Leslie Smith wrote:
Hi:
I have a Cocoa application which draws a (very) large number of line
segments using the code below in a loop, in drawRect, in a subclass
of NSView.
p1 = [NSBezierPath bezierPath] ;
[p1 moveToPoint: linebottom] ;
[p1 lineToPoint: linetop
Are you sure? This could be just a convenient interface for creating a
bezier object with the points passed, stroking it and releasing or
autoreleasing it. The docs say nothing about how it's implemented.
A better idea might be to create ONE bezier object at the top of the
loop, collect all
Blimey! I went to (most) of your lectures! Networks I think it was.
Software Engineerng MSc 1985/6 or thereabouts...
Anyway, have you considered using +strokeLineFromPoint:toPoint:
instead? No need for an NSBezierPath instance.
Cheers,
Matt
(Ok then, some of your lectures)
Hi:
I have a
Le 1 avr. 08 à 14:50, Matt Gough a écrit :
On 1 Apr 2008, at 14:40, Leslie Smith wrote:
I'm sure I'm missing something.
Yes. An understanding of Autorelease pools (and presumably Cocoa
memory management in general)
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Mem
On 1 Apr 2008, at 14:40, Leslie Smith wrote:
I'm sure I'm missing something.
Yes. An understanding of Autorelease pools (and presumably Cocoa
memory management in general)
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html
The unoptimal way to fix your m
Hi:
I have a Cocoa application which draws a (very) large number of line
segments using the code below in a loop, in drawRect, in a subclass
of NSView.
p1 = [NSBezierPath bezierPath] ;
[p1 moveToPoint: linebottom] ;
[p1 lineToPoint: linetop] ;
[p1 stroke] ;
(These are the outputs from a n
13 matches
Mail list logo