public async Task Pasts() { vm.Loading = true; DataPackageView con = Clipboard.GetContent(); if (con.Contains(StandardDataFormats.Bitmap)) { var img = await con.GetBitmapAsync(); WriteableBitmap src = await Img.CreateAsync(img); Exec.Do(new Exec() { exec = delegate { vm.LayerList.Insert(0, new LayerModel() { Bitmap = src }); vm.CurrentLayer = vm.LayerList[0]; }, undo = delegate { vm.LayerList.RemoveAt(0); vm.CurrentLayer = vm.LayerList[0]; } }); } else { await Task.Delay(500); } vm.Loading = false; }
public async Task LoadIMG(StorageFile file, IList <LayerModel> ls, Action <int, int> d = null) { var bmp = await Img.CreateAsync(file); d?.Invoke(bmp.PixelWidth, bmp.PixelHeight); ls.Add(new LayerModel() { Bitmap = bmp }); }
public async Task <string> Handle(Command message) { var generator = new Generator("-", Casing.LowerCase); var imgName = generator.Generate(); generator.Separator = " "; generator.SetParts(WordBank.FirstNames, WordBank.LastNames); generator.Casing = Casing.PascalCase; var artistName = generator.Generate(); await Img.CreateAsync(message.Image, imgName, artistName, _fs, _dc); return(imgName); }