4

How to SetPixel and GetPixel on UIView/UIImageView in IOS

SetPixel(point,color);

color GetPixel(point);

Basically, I want to remove all blue pixels from picture (UIImage) and make them red.

user1480905
  • 41
  • 1
  • 3
  • You should really flesh out your question some if you expect to get any help. What have you tried? What problems have you run into? Is that code supposed to be the prototypes for the functions you want to write? – Tim Jun 26 '12 at 13:38

2 Answers2

4

If you want a drawable canvas ("SetPixel"), you should forget UIImageView and go for a UIView subclass where you can overload the drawRect: method and paint the pixels to whatever color.

As for "GetPixel", here is a complete guide on the topic: How to get the RGB values for a pixel on an image on the iphone

Community
  • 1
  • 1
Lvsti
  • 1,525
  • 15
  • 15
2

To change pixel colour see 'masking an image with colour' on this page.

gigahari
  • 671
  • 1
  • 7
  • 19