• 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: Rasterizing an NSString to a bitmap
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rasterizing an NSString to a bitmap


  • Subject: Re: Rasterizing an NSString to a bitmap
  • From: Public Look <email@hidden>
  • Date: Fri, 11 Jun 2004 19:03:36 -0400

I have been waiting for someone to point the following out and if someone has, I missed it:

You can draw Cocoa strings and in fact anything else that Quartz can render into an Open GL texture and then you have access to the GL texture data through GL calls. In fact, GL will even convert the data to whatever buffer format you specify.

The following includes sample code to convert the contents of any NSView into a texture:

from http://developer.apple.com/qa/qa2001/qa1325.html

"How do I create an OpenGL texture from an NSView? A: Virtually any NSView or subclass thereof can be used as a texture in OpenGL. The basic process involves using an NSBitmapImageRep to store the NSView's image data in a format that can be readily used as texture data by OpenGL... "


There is also the following if strings are the only Quartz graphics of interest:

From http://developer.apple.com/samplecode/Custom_Cocoa_OpenGL/ Custom_Cocoa_OpenGL.html

"Also included is the same stringtexture class as Cocoa OpenGL has, showing how to use an NSImage to write a stirng into and then texture from for high quality font rendering."
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Rasterizing an NSString to a bitmap
      • From: John Stiles <email@hidden>
References: 
 >Rasterizing an NSString to a bitmap (From: John Stiles <email@hidden>)
 >Re: Rasterizing an NSString to a bitmap (From: Marcel Weiher <email@hidden>)
 >Re: Rasterizing an NSString to a bitmap (From: p3consulting <email@hidden>)
 >Re: Rasterizing an NSString to a bitmap (From: Marcel Weiher <email@hidden>)
 >Re: Rasterizing an NSString to a bitmap (From: John Stiles <email@hidden>)
 >Re: Rasterizing an NSString to a bitmap (From: p3consulting <email@hidden>)
 >Re: Rasterizing an NSString to a bitmap (From: John Stiles <email@hidden>)
 >Re: Rasterizing an NSString to a bitmap (From: Dietmar Planitzer <email@hidden>)
 >Re: Rasterizing an NSString to a bitmap (From: John Stiles <email@hidden>)
 >Re: Rasterizing an NSString to a bitmap (From: Dietmar Planitzer <email@hidden>)

  • Prev by Date: Re: NSString initWithCharactersNoCopy
  • Next by Date: Re-Initializing (clearing) a NSTextView object
  • Previous by thread: Re: Rasterizing an NSString to a bitmap
  • Next by thread: Re: Rasterizing an NSString to a bitmap
  • Index(es):
    • Date
    • Thread