UIImage获取灰度图像
来源:互联网 发布:vb与plc以太网通讯 编辑:程序博客网 时间:2024/05/21 08:52
#import <UIKit/UIKit.h>
@interface UIImage(grayImage)
-(UIImage*)getGrayImage;
@end
#import "UIImage+grayImage.h"
@implementation UIImage(grayImage)
-(UIImage*)getGrayImage{
int width =self.size.width;
int height =self.size.height;
CGColorSpaceRef colorSpace =CGColorSpaceCreateDeviceGray();
CGContextRef context =CGBitmapContextCreate (nil,width,height,8,0,colorSpace,kCGImageAlphaNone);
CGColorSpaceRelease(colorSpace);
if (context ==NULL) {
returnnil;
}
CGContextDrawImage(context,CGRectMake(0,0, width, height), self.CGImage);
UIImage *grayImage = [UIImageimageWithCGImage:CGBitmapContextCreateImage(context)];
CGContextRelease(context);
return grayImage;
}
@end
- UIImage获取灰度图像
- 获取UIImage的图像MD5
- opencv获取灰度图像直方图
- 两种获取灰度图像的方法
- 鼠标移动获取视类图像灰度
- VS实现获取图像灰度共生矩阵
- UIImage转为灰度图
- UIImage转为灰度图
- UIIMAGE转为灰度图
- UIImage 转灰度
- UIImage 图像
- 灰度 灰度图像
- 灰度 灰度图像
- 灰度以及灰度图像
- 灰度与灰度图像
- 灰度 灰度图像
- 灰度与灰度图像
- 灰度图像
- 怎样使用UGUI
- mysql查看用户密码、权限等
- <<Effective C++>> 读书笔记6: 继承与面向对象设计
- 关于caffe里面image_data_layer的使用
- 在C#中理解接口
- UIImage获取灰度图像
- 如何开启Centos6.4系统的SSH服务
- 【图解JDK源码】HashMap的基本原理与它的线程安全性
- iOS字符串替换,字符插入,字符删除
- 第二章 线性表
- autobench下载地址
- DPM(Deformable Parts Model)--原理(一)
- 如何将dailog始终居中显示
- jQuery验证插件 Validate详解