iphone - Is it possible to create a CGBitmapContext with a CMYK colorspace and draw into it? -


I am trying to create a bitmap contact with the CMYK colorspace and draw a picture in it.

I am using code from Apple's Q & A, and it has been modified to draw it in the shape of CMYK and draw it in it. In my logs, I get an error

Unsupported pixel details - 4 components, 8 bit-per-component, 32-bit-per-pixel

and I get an empty reference

What am I missing? This is the code that I am trying to run:

  CGContextRef reference = null; CGColorSpaceRef colorpace; Zero * bitmap data; Int bitmapByteCount; Int bitmapBytesPerRow; // Image width, get height We will use the full picture size_t pixels wide = CIggatewidth (iijes); Size_t pixels high = CGMgadget heights (INME); // Announce the number of bytes per line In this example, each pixel in the bitmap is represented by 4 bytes; BitmapBytesPerRow = (pixel wide * 4); BitmapByteCount = (bitmapBytesPerRow * pixelsHigh); // Use Generic CMYK Color Space ColorSpace = CGColorSpaceCreateDeviceCMYK (); If (color space == faucet) {fprintf (stderr, "Error in assigning color space \ n"); Return tap; } // Allocate memory for image data. It is a destination in memory / where bitmap references to any drawing will be provided. Bitmapdata = maulok (bitmapbitech); If (bitmapdata == faucet) {fprintf (stderr, "Memory Not Allowed!"); CGColorSpaceRelease (ColorSpace); Return tap; } // Create a bitmap reference We do not need alpha, despite the source image format // (CMYK, grayscale, and so on), this format will be converted // Specified by CGITMap ContactContact Reference = CGBitmapContextCreate (Bitmapdata, Pixel Wide, Pixel High, 8, // Beat Per Component BitmapbitsPiro, ColorSpace, KCGImageAlphaNouene); If (context == NULL) {free (bitmapdata); Fprintf (stderr, "not made reference!"); } // Make sure that CGColorSpaceRelease releases the color palette before returning to ColorSpace; Return reference;  

Thanks in advance! -SYU

There are no CMY bitmap references on the iPhone OS. But to support pixel formats on the iPhone There is no document about. This is a test and error: (


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -