I'm trying to find a way to programming RGB VOA photos they take themselves. Anyone have any indication?
I think the objection is correct - it is very difficult to check it, however, The solution is relying on being able to get the color of the specific pixel in an image (in this case a UIImageView ...)
} - (UIColor *) getPixelColorAtLocation: (CGPoint) point {
UIColor * Color = Zero; CGImageRef inImage = self.image.CGImage; // To remove the image, turn off the screen bitmap context Format ARGb is 4 bytes for each pixel: Alpa, Red, Green, Blue CGContextRef cgctx = [RGBBetMap ContactFormmizes: iGes]; If (cgctx == faucet) {return zero; / * Error * /} size_t w = CGMmegetWidth (In Eyes); Size_t HK = CGM maggetight (INME); CGRact Rect = {{0,0}, {W, H}}; // Draw the image in the bitmap context. Once we draw, the raw image data will be // in the color space specified in the memory allocated for reference for the presentation. CGContextDrawImage (cgctx, rect, inImage); // Now we can get an indicator in image data associated with bitmap // reference. Unsigned four * data = CGBitmapContextGetData (CGTX); If (data! = Null) {// Offset X, underlines the pixels in data from Y, the data is 4/4 for 4 bytes of 4 pixels, W is the width of one line of data. Int offset = 4 * ((W * round (point.i)) + round (point.x)); Int alpha = data [offset]; Int red = data [offset + 1]; Int green = data [offset + 2]; Int blue = data [offset + 3]; NSLog (@ "Offset:% i Color: RGB A% i% i% i% i", Offset, Red, Green, Blue, Alpha); Color = [UIColor colorWithRed: (red / 255.0F) green: (green / 255.0f) blue: (blue / 255.0f) alpha: (alpha / 255.0f)]; } // When finished, issue the reference CGContextRelease (cgctx); // free image data storage for reference (data) {free (data); } The color of the return;
This code belongs to a color picture class which is the following (C)
// 3/6/09 Made by Markus // Copyright 2009 Mark Johnson All rights reserved.
The full article is here
Comments
Post a Comment