> For the complete documentation index, see [llms.txt](https://philm.gitbook.io/philm-ios-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://philm.gitbook.io/philm-ios-wiki/ui/yyimage-xian-shi-zhi-ding-qu-yu-de-tu-pian.md).

# YYImage  显示指定区域的图片

YYImage 显示区域与图片大小不一致时,默认显示的是居中部分 如果想指定显示区域 需要重写YYImage

以下代码为显示从1/8位置开始的图片

```
#import "PLImage.h"

@implementation PLImage

- (CGRect)animatedImageContentsRectAtIndex:(NSUInteger)index
{
return CGRectMake(0, self.size.height *  1./8., self.size.width, self.size.height);;

}

@end
```
