MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / _flipImage

Function _flipImage

packages/core/ui/styling/background.ios.ts:666–678  ·  view source on GitHub ↗
(originalImage: UIImage)

Source from the content-addressed store, hash-verified

664// Flipping the default coordinate system
665// https://developer.apple.com/library/ios/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GraphicsDrawingOverview/GraphicsDrawingOverview.html
666function _flipImage(originalImage: UIImage): UIImage {
667 UIGraphicsBeginImageContextWithOptions(originalImage.size, false, 0.0);
668 const context = UIGraphicsGetCurrentContext();
669 CGContextSaveGState(context);
670 CGContextTranslateCTM(context, 0.0, originalImage.size.height);
671 CGContextScaleCTM(context, 1.0, -1.0);
672 originalImage.drawInRect(CGRectMake(0, 0, originalImage.size.width, originalImage.size.height));
673 CGContextRestoreGState(context);
674 const flippedImage = UIGraphicsGetImageFromCurrentImageContext();
675 UIGraphicsEndImageContext();
676
677 return flippedImage;
678}
679
680function cssValueToDeviceIndependentPixels(source: string, total: number): number {
681 source = source.trim();

Callers 1

generatePatternImageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected