• 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: Marcel Weiher <email@hidden>
  • Date: Mon, 7 Jun 2004 22:25:03 +0100

On 7 Jun 2004, at 19:26, John Stiles wrote:

I need to draw an NSString into a block of my own memory so I can do effects on it. I just want one grayscale channel. I thought this would be easy but I am stumped! :|
Here's what I've tried to do.

1:
...
- Make an NSBitmapImageRep with the parameters I want (grayscale 1byte per pixel)
...

2:
...
- Make another NSBitmapImageRep with the parameters I want (1 byte per pixel, grayscale)
...

That's the problem right there. You can't make an NSImage draw into a NSBitmapImageRep you provide. You can only get an NSBitmapImageRep out of an NSImage, using the almost but not entirely appropriately named -initWithFocusedViewRect: method.

That will give you an NSBitmapImageRep with the parameters *it* wants ;-)

If you need other parameters, the only way to get this is add some image-processing. (You might be tempted to think that a CoreGraphics bitmap context is the answer, but last time I checked most of the parameter combinations are unsupported).

Cheers,

Marcel
_______________________________________________
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: p3consulting <email@hidden>
    • Re: Rasterizing an NSString to a bitmap
      • From: John Stiles <email@hidden>
References: 
 >Rasterizing an NSString to a bitmap (From: John Stiles <email@hidden>)

  • Prev by Date: Manually update a binding's display pattern
  • Next by Date: Open doc event lost with registration alert at app launch
  • Previous by thread: Rasterizing an NSString to a bitmap
  • Next by thread: Re: Rasterizing an NSString to a bitmap
  • Index(es):
    • Date
    • Thread