Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

NSBitMapImageRep gives error when copying existing image

 
   Mac (Home) -> Programmer Help RSS
Next:  sigio_func  
Author Message
Simon Slavin

External


Since: Aug 24, 2005
Posts: 125



(Msg. 1) Posted: Fri Dec 26, 2008 7:35 am
Post subject: NSBitMapImageRep gives error when copying existing image
Archived from groups: comp>sys>mac>programmer>help (more info?)

[OS X 10.5.6. Xcode 3. All updates. No funny stuff.]

I'm getting the following error in my log

<Error>: CGBitmapContextCreate: unsupported parameter combination: 8
integer bits/component; 24 bits/pixel; 3-component colorspace;
kCGImageAlphaNone; 1536 bytes/row.

when I execute the last line of the following:

NSBitmapImageRep* showListRep = nil;
showListRep = [[[[leftImageView image] representations] objectAtIndex:0]
copy];

[NSGraphicsContext saveGraphicsState];
[NSGraphicsContext setCurrentContext:[NSGraphicsContext
graphicsContextWithBitmapImageRep:showListRep]];


The 'leftImageView' in question is an NSView which has had an image
dragged into it from the Finder. I have tried it with two images
(generated by other people and working perfectly in all other situations)
and both give similar messages. In each case the maths makes sense.

I also tried making up my own image using 'initWithBitmapDataPlanes' and
got the same error when I used the same parameters. However, if I set it
to use 4 samples per pixel (even though I don't need Alpha for this) the
error went away.

If I understand this correctly, the complaint is that it can't use a 3-
component representation as a graphics context. If that's the case, how
come my programs can use these images for other image operations without
problems ?

My finished program doesn't need to work with and OS X < 10.4.

Simon.
--
http://www.hearsay.demon.co.uk
Back to top
Login to vote
Gregory Weston

External


Since: Jun 06, 2005
Posts: 660



(Msg. 2) Posted: Sat Dec 27, 2008 7:58 am
Post subject: Re: NSBitMapImageRep gives error when copying existing image [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <1P%4l.78083$Xy3.43162@newsfe01.ams2>,
Simon Slavin <slavins.delete.these.four.words DeleteThis @hearsay.demon.co.uk>
wrote:

> [OS X 10.5.6. Xcode 3. All updates. No funny stuff.]
>
> I'm getting the following error in my log
>
> <Error>: CGBitmapContextCreate: unsupported parameter combination: 8
> integer bits/component; 24 bits/pixel; 3-component colorspace;
> kCGImageAlphaNone; 1536 bytes/row.


Only certain parameter combinations are supported.

<http://developer.apple.com/documentation/GraphicsImaging/Conceptual/draw
ingwithquartz2d/dq_context/chapter_3_section_4.html#//apple_ref/doc/uid/T
P30001066-CH203-BCIBHHBB>

> If I understand this correctly, the complaint is that it can't use a 3-
> component representation as a graphics context. If that's the case, how
> come my programs can use these images for other image operations without
> problems ?

Because those other operations aren't trying to create bitmap graphics
context from the same images along the way.

--
"Harry?" Ron's voice was a mere whisper. "Do you smell something ... burning?"
- Harry Potter and the Odor of the Phoenix
Back to top
Login to vote
Simon Slavin

External


Since: Dec 28, 2008
Posts: 7



(Msg. 3) Posted: Sun Dec 28, 2008 11:06 pm
Post subject: Re: NSBitMapImageRep gives error when copying existing image [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
<uce-8B938E.07582227122008.TakeThisOut@newsclstr03.news.prodigy.net>Gregory Weston
<uce.TakeThisOut@splook.com> wrote:
> If that's the
>> case, how come my programs can use these images for other image
>> operations without problems ?

> Because those other operations aren't trying to create bitmap
> graphics  context from the same images along the way.

Okay, so some formats are supported for some operations and not
others.That hadn't occurred to me. Thanks.

Simon.

--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo
Back to top
Login to vote
Gregory Weston

External


Since: Jun 06, 2005
Posts: 660



(Msg. 4) Posted: Sun Dec 28, 2008 11:06 pm
Post subject: Re: NSBitMapImageRep gives error when copying existing image [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <nemoSun122808110145.RemoveThis@news.demon.co.uk>,
Simon Slavin <slavins.RemoveThis@hearsay.demon.co.uk> wrote:

> In article
> <uce-8B938E.07582227122008.RemoveThis@newsclstr03.news.prodigy.net>Gregory Weston
> <uce.RemoveThis@splook.com> wrote:
> > If that's the
> >> case, how come my programs can use these images for other image
> >> operations without problems ?
>
> > Because those other operations aren't trying to create bitmap
> > graphics  context from the same images along the way.
>
> Okay, so some formats are supported for some operations and not
> others.That hadn't occurred to me. Thanks.
>
> Simon.

Well, to be fair the only operation you've discovered that supports some
pixel formats and not others is an explicit attempt to create a graphics
context mapped on top of the pixel buffer. Presumably anything else that
needs to do such a thing behind the scenes would create an interim
representation that conforms to the needs of CGBitmapContextCreate. Also
note that according to the link I provided the list of supported pixel
formats for this operation has approximately doubled in size over the
last two OS releases.

--
"Harry?" Ron's voice was a mere whisper. "Do you smell something ... burning?"
- Harry Potter and the Odor of the Phoenix
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Template Syntax Error in Xcode: parse error before `>' token - I'm porting some code over from Codewarrior and have run into a problem with method templates. I have a class with a template method, which passes the typename to another template method of another class object. So in the code below, the mBuffer object..

Copying files om Mac OS... please Help! XCode! - I'm trying to copy file on the same volume, File is a shared library; in the source directory it's size 16 Kbytes. After copying it's size 6 KB, and it has type Excel file!!! ))) And it's doesn't work! Procedure: OSStatus DoStupidCopy(char *pszSrcPath...

error: parse error before "}" token (newbie needs help) - Hello First post on this board with a question relating to my first venture into xcode, I have a little bit of programming experience on the windows side, im new to macs as well so please go easy on me.. I have system 10.3.9 and am using xcode version....

Creating text image in code - What's the easiest (i.e least amount of code) way to generate an NSImage with black text on a transparent background? It needs to be done in code, as the text will be constantly changing. (The last time I did any 2D graphics programming was in QuickDraw...

What causes the 'can't map file' error? - I'm porting open source for Linux to Mac OS X. I think I generated every .a or .lib but the final link gives an error message. /usr/bin/ld: can't map file: /Users/smcho/Desktop/OpenAccess/lib/mac_osx_32/opt ((os/kern) invalid argument) What might be..
       Mac (Home) -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
 Linux Forums
  Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact