• 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: Cocoa-dev Digest, Vol 2, Issue 1308
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa-dev Digest, Vol 2, Issue 1308


  • Subject: Re: Cocoa-dev Digest, Vol 2, Issue 1308
  • From: Bill Monk <email@hidden>
  • Date: Wed, 31 Aug 2005 01:00:53 -0600


On Aug 30, 2005, at 5:06 AM, Arik Devens wrote:

The code works on some images and not others, but I haven't been able to
figure out why some work and some don't. For the ones that don't I get a
totally skewed grayscale image...


NSBitmapImageRep *destImageRep = [[NSBitmapImageRep alloc]
initWithBitmapDataPlanes:nil
pixelsWide:widthInPixels
pixelsHigh:heightInPixels
bitsPerSample:8
samplesPerPixel:1
hasAlpha:NO
isPlanar:NO
colorSpaceName:NSCalibratedWhiteColorSpace
bytesPerRow:0
bitsPerPixel:8];



Try changing bytesPerRow: from 0 to the actual calculated rowBytes value.


The docs seem to say that passing 0 is OK, but in Tiger this seems not to work anymore.

I've run across another sample which used initWithBitmapDataPlanes: and which worked fine under Pather/Jaguar, but which exhibited skewing and tearing of the image under Tiger. Passing the real # of bytes per row fixed it.

Bill

_______________________________________________
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


  • Prev by Date: Re: What's happening with PNG ?
  • Next by Date: Re: Where can I find information on making my program apple scriptable?
  • Previous by thread: Re: Where can I find information on making my program apple scriptable?
  • Next by thread: Check if a Nib is alredy loaded
  • Index(es):
    • Date
    • Thread