Percent Resizing

// Resize
UIImage *img_mae = [UIImage imageNamed:@"hoge.png"];  // 전
UIImage *img_ato;  // 후
float widthPer = 1.5;  // 후폭 배율
float heightPer = 1.5;  // 후높이 배율

CGSize sz = CGSizeMake(img_mae.size.width*widthPer,
                                        img_mae.size.height*heightPer);
UIGraphicsBeginImageContext(sz);
[img_mae drawInRect:CGRectMake(0, 0, sz.width, sz.height)];
img_ato = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext(); 

댓글

이 블로그의 인기 게시물

파이썬으로 Homomorphic Filtering 하기

파이썬으로 2D FFT/iFFT 하기: numpy 버전