• 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: NSImage and 8 bit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage and 8 bit


  • Subject: Re: NSImage and 8 bit
  • From: Marcel Weiher <email@hidden>
  • Date: Tue, 30 Nov 2004 10:56:20 +0000


On 30 Nov 2004, at 08:26, Robert W. Kuhn wrote:




Thank you for your help. I discovered that I have to use initWithBitmapDataPlanes: pixelsWide: pixelsHigh: bitsPerSample: samplesPerPixel: hasAlpha: isPlanar: colorSpaceName: bytesPerRow: bitsPerPixel:


Why? Why not use +imageRepWithData:


Ugly code.

Yes.

Not very handy to load first the image (to get width and
height)
 and the the data again.


Why do you need the NSImage to get the width/height



This is probably a cached representation, so you are getting the depth
of the bitmap cache.  The last time I checked NSImage discards the
original data unless you tell it to -setDataRetained:YES.


I also did try this. I always get only 32bit-Data. Also the NSImage has always only one NSBitmaprepresentation - the 32bit data.

You are probably still getting the cached representation with your code. Try logging all the representations, I think you will see that the original image data is now present.


Marcel




-- Marcel Weiher Metaobject Software Technologies email@hidden www.metaobject.com Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc. 1d480c25f397c4786386135f8e8938e4

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSImage and 8 bit (From: "Robert W. Kuhn" <email@hidden>)
 >Re: NSImage and 8 bit (From: Marcel Weiher <email@hidden>)
 >Re: NSImage and 8 bit (From: "Robert W. Kuhn" <email@hidden>)

  • Prev by Date: context menu for text in textfields
  • Next by Date: Re: Updating the Dock Trash icon when trashing a file
  • Previous by thread: Re: NSImage and 8 bit
  • Next by thread: Authorisation catch-22 with NSOpenPanel
  • Index(es):
    • Date
    • Thread