Catrobat.IDE.Core.Utilities.Helpers.LookHelper.ReplaceImageInStorage C# (CSharp) Метод

ReplaceImageInStorage() публичный статический Метод

public static ReplaceImageInStorage ( Program project, Look look, PortableImage newImage ) : System.Threading.Tasks.Task
project Program
look Look
newImage PortableImage
Результат System.Threading.Tasks.Task
        public static async Task ReplaceImageInStorage(Program project, Look look, PortableImage newImage)
        {
            var path = Path.Combine(project.BasePath, StorageConstants.ProgramLooksPath, look.FileName);

            using (var storage = StorageSystem.GetStorage())
            {
                await storage.SaveImageAsync(path, newImage, true, ImageFormat.Png);
                look.Image = await storage.LoadImageThumbnailAsync(path);
            }
        }
    }