user1480905
user1480905

Reputation: 41

How to SetPixel and GetPixel on UIView/UIImageView in iOS

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.

Upvotes: 4

Views: 2836

Answers (2)

gigahari
gigahari

Reputation: 681

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

Upvotes: 2

Lvsti
Lvsti

Reputation: 1525

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

Upvotes: 4

Related Questions