`

UIImage and UIImageView

 
阅读更多
动画效果
http://hi.baidu.com/niguang1024/blog/item/71cffca9188e25f11f17a226.html

图片点击
UIImageView.userInteractionEnabled = NO;

UIView.userInteractionEnabled = YES;  // default is YES. if set to NO, user events (touch, keys) are ignored and removed from the event queue.
配合UITouch使用。
http://blog.csdn.net/iorchid/article/details/6398102
--------------------------------------




UIImage 图片处理:截图,缩放,设定大小,存储:
http://my.oschina.net/rareliu/blog/24322
局部拉伸:- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight;
--------------------------------------



加载
[UIImage imageNamed:@"icon.png"];
//A or B/C
[UIImage imageWithData:[NSData dataWithContentsOfFile:filePath]];
[UIImage imageWithContentsOfFile:aImagePath];


A的优点是不会重复,缺点是使用cache,面对大图就力不从心了
B刚好相反
http://www.cocoachina.com/bbs/read.php?tid=27420&page=1
http://toyota2006.iteye.com/blog/973682
--------------------------------------
分享到:
评论

相关推荐

    Programming iOS 7, 4th Edition - 2013.pdf

    **2.1 图像与图像视图(UIImage and UIImageView)** - **定义**:`UIImage`类用于表示和处理图像,`UIImageView`则是用来显示图像的视图。 - **用法**:通过`imageView.image = [UIImage imageNamed:@"imageName"]...

    iOS中 UIImage根据屏宽调整size的实例代码

    例如,假设你有一个UIImageView,你想让它根据屏幕宽度自动调整UIImage的高度,你可以这样做: ```objc UIImage *image = ...; // 原始图像 CGSize size = image.size; image = [image imageByScalingToSize:...

    LBBlurredImage-master

    Just grab the two file named UIImageView+LBBlurredImage {h m} and UIImageImage+ImageEffects {h m} in the Additions group into your project and link with Accelerate framework #import "UIImageView...

    iOS OC 加载动图(gif)

    `FLAnimatedImage`是由Facebook开源的一个高效、高性能的GIF处理库,它是基于`UIImage`和`UIImageView`的扩展。这个库在内存管理和性能优化方面做得很好,适合在iOS应用中使用。 4. **集成FLAnimatedImage** 首先...

    Image Reflection

    本教程将深入探讨如何在iOS应用中实现图片的倒影效果,主要涉及的知识点包括UIKit框架中的UIImageView类、Core Graphics(简称Core Graphics或CG)以及自定义视图的绘制。 首先,UIImageView是iOS中用于显示图像的...

    swift-类似专辑封面效果随手指滚动放大缩小的滚动展示图

    9. **Data Source and Delegate**: 如果使用UICollectionView,需要遵循UICollectionViewDataSource和UICollectionViewDelegate协议,以提供数据并响应用户交互。 10. **Custom Cell**: 自定义UICollectionViewCell...

    iPad上的image流畅缩放

    6. **性能优化**:在处理大图像时,为避免内存过载,可以使用UIImage的`resizableImageWithCapInsets`方法来创建可伸缩的图像,或者在需要时才加载高分辨率的图像。同时,合理利用OpenGL ES或Metal进行硬件加速,...

    iPhone SDK示例代码解析

    - **注意**:“Fire and Forget”动画意味着一旦动画开始,就不会再受到其他操作的影响。 #### 8. NSString和int类型转换 在Objective-C中,经常需要处理不同数据类型之间的转换,例如将整型转换为字符串或反之。 ...

    opencv2.framework 3.4

    3. 显示图像:在iOS应用中,可以使用`UIImage`和`UIImageView`将处理后的OpenCV矩阵转换为可以显示的图像。 4. 实时视频处理:通过`AVFoundation`框架捕获摄像头实时视频流,然后利用OpenCV处理每一帧。 **5. 特性...

    iOS_Animations_by_Tutorials_v4.0内含所有章节的代码资源

    最后,"27-frame-animations-with-uiimageview"部分讲解了基于图像帧的动画,通常用于实现GIF动图或者连续的序列帧动画效果。通过UIImage数组和CADisplayLink,可以轻松地创建出这类动画。 总而言之,《iOS_...

    swift-只需要几行简单的代码就可以引入多选照片并引用的功能模块

    标题"swift-只需要几行简单的代码就可以引入多选照片并引用的功能模块"以及描述"pickImage and quote,通过简单地贴上view,就能实现这一功能"表明,这个功能模块设计得非常简洁且易于集成。这里我们将深入探讨如何...

    UITableView 实现汽车品牌(demo)

    在Storyboard中设计Cell,设置它的identifier为"CarCell",添加一个UIImageView和一个UILabel,分别显示汽车图标和名称。 最后,对于性能优化,重要的是要理解并正确使用UITableViewCell的复用机制。在`tableView(_...

Global site tag (gtag.js) - Google Analytics