Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
27 changes: 0 additions & 27 deletions src/Controls/tests/TestCases.HostApp/Issues/FontImageUITest.cs

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
22 changes: 9 additions & 13 deletions src/Graphics/src/Graphics/Platforms/iOS/UIImageExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,17 @@ public static UIImage ScaleImage(this UIImage target, float maxWidth, float maxH

public static UIImage ScaleImage(this UIImage target, CGSize size, bool disposeOriginal = false)
{
using (var renderer = new UIGraphicsImageRenderer(size))
{
var resultImage = renderer.CreateImage((UIGraphicsImageRendererContext imageContext) =>
{
var cgcontext = imageContext.CGContext;
cgcontext.DrawImage(new CGRect(CGPoint.Empty, size), target.CGImage);

if (disposeOriginal)
{
target.Dispose();
}
});
UIGraphics.BeginImageContext(size);
target.Draw(new CGRect(CGPoint.Empty, size));
var image = UIGraphics.GetImageFromCurrentImageContext();
UIGraphics.EndImageContext();

return resultImage;
if (disposeOriginal)
{
target.Dispose();
}

return image;
}

public static UIImage NormalizeOrientation(this UIImage target, bool disposeOriginal = false)
Expand Down