• 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: Problems with NSGraphicsContext
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with NSGraphicsContext


  • Subject: Re: Problems with NSGraphicsContext
  • From: John Curtis <email@hidden>
  • Date: Tue, 28 Feb 2006 22:50:33 +0000

Aki,

Upon investigation using this code:

//////////////////////////
NSBitmapImageRep* image = [[NSBitmapImageRep alloc] initWithData: [NSData dataWithContentsOfFile:str]];

NSLog(@"Number of planes %d", [image numberOfPlanes]);


	if([image isPlanar]){
		NSLog(@"The image is planar");
	}else{
		NSLog(@"The image is non planar");
	}
//////////////////////////

I find that the image is non planar and has 1 plane. I think that CGBitmapContext coveres a JPEG format, which is the file that the image has been instantiated with.

Is there anything else that might cause such a problem?

Thanks,
John


On 28 Feb 2006, at 22:40, Aki Inoue wrote:

John,

Currently the method supports only non-planar NSBitmapImageRep with formats covered by CGBitmapContext.

See http://graphics.apple.com/Documents/CGBitmapContext.html for supported formats.

Aki

Hello,

I am trying to instantiate a NSGraphicsContext with an NSBitmapImageRep but the method:

[NSGraphicsContext graphicsContextWithBitmapImageRep:myImageRep]

keeps returning nil for no reason that I can see. The object myImageRep works fine, I am sure of that. I use it in the following context:

NSGraphicsContext* graphics = [[NSGraphicsContext graphicsContextWithBitmapImageRep:myImageRep] retain];

Does anyone know under what reasons would this method return nil if there is no problem with the NSBitmapImageRep?

Thanks
_______________________________________________
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


_______________________________________________ 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
  • Follow-Ups:
    • Re: Problems with NSGraphicsContext
      • From: Aki Inoue <email@hidden>
References: 
 >Problems with NSGraphicsContext (From: John Curtis <email@hidden>)
 >Re: Problems with NSGraphicsContext (From: Aki Inoue <email@hidden>)

  • Prev by Date: fast window movement and animation
  • Next by Date: NSPopUpButton - aligning to top vertically
  • Previous by thread: Re: Problems with NSGraphicsContext
  • Next by thread: Re: Problems with NSGraphicsContext
  • Index(es):
    • Date
    • Thread