- (UIImage*) createImageWithColor: (UIColor*) color
{
CGRect rect=CGRectMake(0,0,
1, 1);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurren...
分类:
其他好文 时间:
2015-01-26 19:22:52
阅读次数:
226
1.在添加图片操作时,通过UIImage对象进行添加图片操作
1.[UIImage imageName:@"1.png"]
2.[UIImage imageWithContentsOfFile:@"1.png"]
在添加图片操作时,先对图片大小进行修改,操作如下:
注:这里是UIImage的category扩展类
①UIImage+Scale.h声明文件,传入一个CGSize参数,即图片...
分类:
移动开发 时间:
2015-01-26 12:02:42
阅读次数:
199
google出品 高清晰,体量小得图片格式,下面说在iOS下如何使用
添加头文件
#import "UIImage+WebP.h"
#import "ViewController.h"
#import "UIImage+WebP.h"
@interface ViewController ()
@property (nonatomic ,strong) UIImageView *webP...
分类:
移动开发 时间:
2015-01-24 15:56:59
阅读次数:
315
获取轮廓#import #import #import @implementation OpenCVHelper+(UIImage *)getImageOutLine:(UIImage *)iputimg{ cv::Mat cvImage; UIImageToMat(iputimg, c...
分类:
其他好文 时间:
2015-01-23 13:16:22
阅读次数:
173
图片水印功能 1 #import "UIImage+ZR.h" 2 3 @implementation UIImage (ZR) 4 + (instancetype)waterImageWithBg:(NSString *)bg logo:(NSString *)logo 5 { 6 UI...
分类:
移动开发 时间:
2015-01-23 12:34:38
阅读次数:
337
这里用的是CIImage,同样可以转换成UIImage。内容比较简单,适合初学者。(自己忘记时看看,严禁商业转载)
//第一种,从应用程序包中(资源文件)加载图像
NSString * path = [[NSBundle
mainBundle] pathForResource:@"1"
ofType:@"png"];
NSURL * pathURL = [N...
分类:
其他好文 时间:
2015-01-21 10:19:57
阅读次数:
166
1.截取当前屏幕
CGSize windowSize = behandView.bounds.size;
UIGraphicsBeginImageContextWithOptions(windowSize, YES, 2.0);
CGContextRef context = UIGraphicsGetCurrentContext();
[behandVi...
分类:
移动开发 时间:
2015-01-20 18:11:44
阅读次数:
282
UIView 都有方法:setCenter, setBoundssetCenter 是设置控件的中心点setBounds是设置控件的大小控件被加在某个View内,则跟着所附属的View移动.UIScrollView 滚动视图1.png格式的文件不需要家后缀即可使用:UIImage *image = ...
分类:
移动开发 时间:
2015-01-20 11:50:00
阅读次数:
202
//加入下面两行代码即可[[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];[[UINavigationBar appearance] s...
分类:
其他好文 时间:
2015-01-20 10:25:12
阅读次数:
108
//创建图片视图时就设定Frame的属性和大小 UIImageView *img = [[UIImageView alloc] initWithFrame:CGRectMake(60, 20, 80, 100)]; [img setImage:[UIImage imageNamed:@"mtxx.....
分类:
移动开发 时间:
2015-01-19 22:16:04
阅读次数:
270