Re: Rasterizing an NSString to a bitmap
Re: Rasterizing an NSString to a bitmap
- Subject: Re: Rasterizing an NSString to a bitmap
- From: John Stiles <email@hidden>
- Date: Mon, 14 Jun 2004 17:46:52 -0700
FWIW, Apple's best answer was -initWithFocusedViewRect, and a promise
from the engineer involved that it will only return a certain type of
bitmap buffer. Not the best answer in the world, but if I've got it in
writing from an Apple representative, that's almost as good as
documentation.
On Jun 11, 2004, at 4:03 PM, Public Look wrote:
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.