0
A
回答
1
我不知道,這將使這個開箱即用的任何功能。 但是你可以編寫自己的功能。所有你需要做的就是逐個獲取像素的顏色,並確定它們是否是正確的。
爲了得到這個,你可以使用下面的代碼。
CGImageRef image = [myUIImage CGImage];
NSUInteger width = CGImageGetWidth(image);
NSUInteger height = CGImageGetHeight(image);
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
unsigned char *rawData = malloc(height * width * 4);
NSUInteger bytesPerPixel = 4;
NSUInteger bytesPerRow = bytesPerPixel * width;
NSUInteger bitsPerComponent = 8;
CGContextRef context = CGBitmapContextCreate(rawData, width, height, bitsPerComponent, bytesPerRow, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
CGColorSpaceRelease(colorSpace);
CGContextDrawImage(context, CGRectMake(0, 0, width, height));
CGContextRelease(context);
// Now your rawData contains the image data in the RGBA8888 pixel format.
int byteIndex = (bytesPerRow * yy) + xx * bytesPerPixel;
red = rawData[byteIndex];
green = rawData[byteIndex + 1];
blue = rawData[byteIndex + 2];
alpha = rawData[byteIndex + 3];
這最初發布此question.
相關問題
- 1. Matplotlib在圖像透明填充
- 2. 使用kineticjs填充圖像的非透明部分
- 3. actionscript 3.0透明圖像填充
- 4. 在ImageView中的不透明圖像上的透明圖像
- 5. 非透明圖像
- 6. 非透明圖像
- 7. 用PHP中的圖案圖像填充圖像的透明部分
- 8. 帶透明填充的NSBezierPath
- 9. ImageMagic php中的模糊洪水填充 - 製作透明圖像
- 10. 在p-tag中填充半透明圖像覆蓋
- 11. Javascript - 畫布 - 在previousley上填充透明png填充顏色
- 12. 使圖像透明在IE中顯示非透明背景
- 13. 在圖像中設置透明度IOS
- 14. CSS圖像填充圖像中間具有透明元素的所有屏幕
- 15. 打開圖層:填充多邊形並非真正透明,更像是帶有不透明度的白色
- 16. 透明圖像在xfa.fillXfaForm之後顯示爲黑色框。是否支持xfa填充的透明圖像?
- 17. iOS着色透明圖像
- 18. 操作欄填充背景錯誤的透明圖標像素
- 19. 用透明像素填充緩衝圖像
- 20. VBA在透明度與實心填充之間區分圖像
- 21. 在視圖中具有非透明文本的透明背景圖像
- 22. 圖層不透明度vs填充Photoshop
- 23. 在透明圖像上放置透明圖像
- 24. 在另一個透明圖像上移動透明圖像
- 25. 透明圖像在IE中不透明
- 26. 用geom_violin填充透明度
- 27. 開羅填充透明
- 28. ImageView ColorFilter在非透明像素上。 Clip
- 29. 透明度着色器用透明色填充透明片段
- 30. PNG圖像顯示在IOS半透明