mirror of
https://github.com/danog/Telegram.git
synced 2024-11-30 04:29:15 +01:00
12 lines
409 B
Objective-C
12 lines
409 B
Objective-C
#import "TGScaleImage.h"
|
|
|
|
UIImage *TGScaleImage(UIImage *sourceImage, CGSize pixelSize)
|
|
{
|
|
UIGraphicsBeginImageContextWithOptions(pixelSize, true, 1.0f);
|
|
[sourceImage drawInRect:CGRectMake(0.0f, 0.0f, pixelSize.width, pixelSize.height) blendMode:kCGBlendModeCopy alpha:1.0f];
|
|
UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
|
|
UIGraphicsEndImageContext();
|
|
|
|
return result;
|
|
}
|