本文介绍了如何在iOS中从CGImage读取RBG-像素值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将其分配给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):

检索UIImage的像素alpha值(MonoTouch)

您还可以找到以下有用的帖子:

You can also find the following post useful:

用于iOS的Monotouch中的透明PNG

这是卷积滤波器的有效实现的链接,该函数读取和解消像素的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):

如何在MonoTouch?

请记住,即使您使用技巧创建仅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-像素值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 05:50