• 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: Thu, 10 Jun 2004 20:42:59 +0100

[image lockFocus];
[myObject draw];
bitmap = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:myRect]
autorelease];
[image unlockFocus];

That's the canonical method of getting a bitmap of a rendered graphic
in Cocoa, as far as I am aware, and is independent of NSImage
implementation details. Another method is to get the
TIFFRepresentation, and then re-reading that, but that involves an
extra encoding/decoding step.



Nice, but the problem begin when you modify the NSBitmapImageRep by
accessing directly the pixels
and then try to make a new image from the modified pixels...

Ahh, that is to be expected. -initWithFocusedViewRect: does not give you access to the backing store, instead it makes a copy. So this is not for incremental drawing onto the backing store, it is for retrieving the result when it is done.

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.


  • Follow-Ups:
    • Re: Rasterizing an NSString to a bitmap
      • From: p3consulting <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>)
 >Re: 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>)

  • Prev by Date: Re: two things (newbie)
  • Next by Date: Re: Rasterizing an NSString to a bitmap
  • Previous by thread: Re: Rasterizing an NSString to a bitmap
  • Next by thread: Re: Rasterizing an NSString to a bitmap
  • Index(es):
    • Date
    • Thread