将图像DataURL另存为磁盘上的图像 [英] Save Image DataURL as an image on disk

查看:62
本文介绍了将图像DataURL另存为磁盘上的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将Image DataURL保存为磁盘上的图像?

How to save Image DataURL as an image on a disk?

推荐答案

如果我理解正确 您想要从中下载图像网络到磁盘 


试试这个代码



       
if i understood correctly you want to download an Image from the web to the disk 

try this code

       

async void DownloadImage (string URL)        {           Uri u = new Uri(URL);  StorageFile destinationFile = await ApplicationData.Current.LocalFolder.CreateFileAsync("ImageTargetName", CreationCollisionOption.ReplaceExisting);     

BackgroundDownloader downloader = new BackgroundDownloader(); 

BackgroundDownloader downloader = new BackgroundDownloader(); 

var download = downloader.CreateDownload(u,destinationFile);

var download = downloader.CreateDownload(u, destinationFile);

download.StartAsync() ;   
 }

download.StartAsync();     }





这篇关于将图像DataURL另存为磁盘上的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆