Re: Rasterizing an NSString to a bitmap
Re: Rasterizing an NSString to a bitmap
- Subject: Re: Rasterizing an NSString to a bitmap
- From: Marcel Weiher <email@hidden>
- Date: Tue, 8 Jun 2004 00:26:50 +0100
On 7 Jun 2004, at 23:02, John Stiles wrote:
OK, so I need to make an NSImage and then turn it into an
NSBitmapImageRep via initWithFocusedViewRect?
Yep.
That's kind of perverse. I don't have an NSView, after all :)
;-) Fortunately, -initWithFocusedViewRect: will also work on a
focusedNSImageRect:
I can do this, though. But how do I know what kind of NSBitmapImageRep
I got back?
You ask it.
The documentation doesn't say, so theoretically does that mean it
could be according to the whims of the system?
Yes, pretty much.
Maybe planar and maybe chunky,
Used to always be chunky, haven't checked recently
maybe 32bpp or maybe 16 (certainly won't be the grayscale that I'm
aiming for),
Yep. However, if grayscale is what you are aiming for, CoreGraphics
might be of help after all.
maybe with alpha and maybe without? Ick ick ick.
Padded to 32/16 bits, Cocoa always used to use RGBA, even on ARGB
framebuffers/backing stores. Don't know if this is still the case.
At this point is there any way to ask the NSBitmapImageRep to resample
itself to any sort of known parameters?
No, you have to implement that yourself.
Or to get it to draw itself into a new NSBitmapImageRep of my
choosing?
I have no problem with convoluting the image to make it do what I
want, but since the destination format of initWithFocusedViewRect is
undocumented, it seems like I need to write a whole blitter library to
do the resample, or force my app to assume that whatever
initWithFocusedViewRect does now is what it will do indefinitely.
Actually, there are ways of querying this stuff. Check the docs.
Cheers,
Marcel
--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
1d480c25f397c4786386135f8e8938e4
_______________________________________________
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.