问题描述
在将其分配给UIImage之后,如何从CGImagea中读取RGB-Pixel by Pixel值
How I can Read the RGB-Pixel by Pixel values from CGImagea also after how to assign it to UIImage
推荐答案
要使用MonoTouch读取RGB像素值,您可以使用以下帖子的答案中发布的代码(对我而言很好):
To read RGB pixel values with MonoTouch you can use the code posted in the answer to the following post (works fine for me):
您还可以找到以下有用的帖子:
You can also find the following post useful:
这是卷积滤波器的有效实现的链接,该函数读取和解消像素的rgb值(在iOS上,所有具有alpha通道的图像均以预乘alpha格式存储):
And here is a link to a working implementation of mine of a convolution filter, that reads and demultiplies the pixel's rgb values (on iOS all images with alpha channel are stored in a premultiplied-alpha format):
请记住,即使您使用技巧创建仅1x1像素的位图上下文,读取像素值也非常慢.
Remember that reading pixel values is very slow, even if you use the trick to create a bitmap context of only 1x1 pixels.
这篇关于如何在iOS中从CGImage读取RBG-像素值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!