Re: Possible to draw an NSMutableAttributedString into a CGContextRef?
Re: Possible to draw an NSMutableAttributedString into a CGContextRef?
- Subject: Re: Possible to draw an NSMutableAttributedString into a CGContextRef?
- From: "Albert Andersen" <email@hidden>
- Date: Fri, 13 Apr 2007 10:58:23 -0700
You could create an NSGraphicsContext with
+graphicsContextWithGraphicsPort and then render the string into it.
graphicsContextWithGraphicsPort:flipped:
Instantiates and returns a new graphics context from the given graphics port.
+ (NSGraphicsContext *)graphicsContextWithGraphicsPort:(void
*)graphicsPort flipped:(BOOL)initialFlippedState
Parameters
graphicsPort
The graphics port used to create the graphics-context object.
Typically graphicsPort is a CGContextRef (opaque type) object.
initialFlippedState
Specifies the receiver's initial flipped state. This is the value
returned by isFlipped when no view has focus.
Return Value
The created NSGraphicsContext object or nil if the object could not be created.
Availability
Available in Mac OS X v10.4 and later.
-Albert
On 4/13/07, Ken Tozier <email@hidden> wrote:
Hi
I have an old version of some code that needed speeding up so I
rewrote most of it with CGxxx calls. One part I don't want to
rewrite, as it's fairly complicated, is the construction of an
NSMutableAttributedString. Is it possible to write this finished
attributed string to a CGContextRef? If so, how would it be done?
Thanks for any help
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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