• 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: Possible to draw an NSMutableAttributedString into a CGContextRef?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Possible to draw an NSMutableAttributedString into a CGContextRef?
      • From: Scott Ribe <email@hidden>
References: 
 >Possible to draw an NSMutableAttributedString into a CGContextRef? (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: super constructor encapsulation
  • Next by Date: Re: ScriptEditor thinks my command is a variable
  • Previous by thread: Possible to draw an NSMutableAttributedString into a CGContextRef?
  • Next by thread: Re: Possible to draw an NSMutableAttributedString into a CGContextRef?
  • Index(es):
    • Date
    • Thread