1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-04 10:27:46 +01:00
Telegram/Share/TGScaleImage.m

12 lines
409 B
Mathematica
Raw Normal View History

2015-10-01 18:19:52 +02:00
#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;
}