mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
perf(ios): uifont and formatted string optimizations plus uiimage scaling (#9761)
This commit is contained in:
@@ -440,18 +440,7 @@ function getFileName(path: string): string {
|
||||
}
|
||||
|
||||
function getImageData(instance: UIImage, format: 'png' | 'jpeg' | 'jpg', quality = 0.9): NSData {
|
||||
let data = null;
|
||||
switch (format) {
|
||||
case 'png':
|
||||
data = UIImagePNGRepresentation(instance);
|
||||
break;
|
||||
case 'jpeg':
|
||||
case 'jpg':
|
||||
data = UIImageJPEGRepresentation(instance, quality);
|
||||
break;
|
||||
}
|
||||
|
||||
return data;
|
||||
return NativeScriptUtils.getImageDataFormatQuality(instance, format, quality);
|
||||
}
|
||||
|
||||
export function fromAsset(asset: ImageAsset): Promise<ImageSource> {
|
||||
|
||||
Reference in New Issue
Block a user