开发者

Increase/Decrease brightness of a UIImageView

开发者 https://www.devze.com 2023-03-31 01:25 出处:网络
Does anybody know 开发者_如何学编程how to change the brightness of a UIImageView in objective-C? Also, is there a way to increase/decrease the size of the UIImage?Check out the UIImage (void)drawInRec

Does anybody know 开发者_如何学编程how to change the brightness of a UIImageView in objective-C? Also, is there a way to increase/decrease the size of the UIImage?


Check out the UIImage (void)drawInRect:(CGRect)rect blendMode:(CGBlendMode)blendMode alpha:(CGFloat)alpha method and see what you can create. Otherwise, you are going to have to do some more in depth work increasing the brightness of each pixel in HSV color space (proportionately increasing the V values). By blending the image with a white image using the right blend mode though, you should be able to brighten the UIImage contained within the UIImageView.

EDIT:

Also, as I answered in your other question, the UIImage will scale to fit the UIImageView. The image data itself will not scale, but the onscreen rendering will.

0

精彩评论

暂无评论...
验证码 换一张
取 消