首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏林德熙的博客

    UWP 从文件 StorageFile 转 SoftwareBitmap 图片方法

    本文告诉大家如何在 UWP 从 文件 StorageFile 转 SoftwareBitmap 图片的方法 使用以下三步即可从文件 StorageFile 转 SoftwareBitmap 图片 第一步是读取文件 decoder.GetSoftwareBitmapAsync(); 我封装的代码如下 private static async Task<SoftwareBitmap> StorageFileToSoftwareBitmapAsync(StorageFile

    50310编辑于 2022-08-12
  • 来自专栏林德熙的博客

    win10 uwp 从StorageFile获取文件大小

    本文主要:获取文件大小 private async Task<ulong> FileSize(Windows.Storage.StorageFile file) { var

    95220编辑于 2022-08-09
  • 来自专栏林德熙的博客

    win10 uwp 判断文件存在

    { StorageFolder folder = ApplicationData.Current.LocalFolder; StorageFile file = await StorageFile.GetFileFromPathAsync(folder.Path + "\\" + str); } catch false; var allfiles = await ApplicationData.Current.LocalFolder.GetFilesAsync(); foreach (var storageFile in allfiles) { if (storageFile.Name == fileName) { fileExists = true ; } } return fileExists; } 如果我有很多文件,那么这样也是不好 我们有比较好的方法 StorageFile file;

    92320发布于 2018-09-18
  • 来自专栏林德熙的博客

    win10 uwp 判断文件存在

    { StorageFolder folder = ApplicationData.Current.LocalFolder; StorageFile file = await StorageFile.GetFileFromPathAsync(folder.Path + "\\" + str); } catch false; var allfiles = await ApplicationData.Current.LocalFolder.GetFilesAsync(); foreach (var storageFile in allfiles) { if (storageFile.Name == fileName) { fileExists = true ; } } return fileExists; } 如果我有很多文件,那么这样也是不好 我们有比较好的方法 StorageFile file;

    59720编辑于 2022-08-07
  • 来自专栏四楼没电梯

    Win8 文件相关操作

                    };                 openPicker.FileTypeFilter.Add("*");                 StorageFile await file.GetBasicPropertiesAsync();                 UInt64 size = pro.Size; 3.convert StorageFile to byte[] var bytes = await GetBtyeFromFile(file);   // This is the method to convert the StorageFile  to a Byte[]         private async Task GetBtyeFromFile(StorageFile storageFile)   {       var stream  = await storageFile.OpenReadAsync();   using (var dataReader = new DataReader(stream))       {  

    53210编辑于 2024-10-12
  • 来自专栏林德熙的博客

    win10 uwp 从StorageFile获取文件大小 获取用户最近使用文件

    本文主要:获取文件大小 private async Task<ulong> FileSize(Windows.Storage.StorageFile file) { var

    2.2K10发布于 2018-09-18
  • 来自专栏java架构师

    【WP之一】]独立存储

    class MainPage : PhoneApplicationPage { //为程序获取一个虚拟的本地存储 IsolatedStorageFile storageFile storageFile.DirectoryExists(filePath)) { storageFile.CreateDirectory(filePath ); } //写入 using (StreamWriter writer = new StreamWriter(storageFile.OpenFile storageFile.FileExists(fullFilePath)) { txbReadContent.Text = "指定文件不存在" return; } //读取 using (StreamReader reader = new StreamReader(storageFile.OpenFile

    78460发布于 2018-04-16
  • 来自专栏码匠的流水账

    聊聊flink的BlobWriter

    , jobId, blobKey, storageFile, LOG, blobKey instanceof PermanentBlobKey ? ", blobKey, jobId); } storageFile = null; } finally { // storageFile.delete() && storageFile.exists()) { log.warn("Could not delete the storage ", storageFile); } if (incomingFile != null && ! ,如果blobStore不为null,还会将storageFile放入到BlobStore doc BlobWriter

    78620发布于 2019-02-28
  • 来自专栏林德熙的博客

    win10 UWP 剪贴板 Clipboard 设置文本获取文本获取图片获取文件

    "image"; StorageFolder folder = await _folder.GetFolderAsync(str); StorageFile { var filelist = await con.GetStorageItemsAsync(); foreach (StorageFile in filelist) { } } IStorageItem 转 StorageFile if (t.IsOfType(StorageItemTypes.File)) { StorageFile storageFile = storageItem as StorageFile; } 在以前的软件,可以用过剪贴板获得任意内容,而uwp只能获得有限的内容

    2.6K10发布于 2018-09-18
  • 来自专栏林德熙的博客

    win10 uwp 修改图片质量压缩图片

    imageQuality 就是图片质量,这个需要传入 从一个图片文件压缩图片大小的方法可以这样写,创建一个方法传入原图文件,和需要输出的文件,和图片质量 private async Task<StorageFile > ConvertImageToJpegAsync(StorageFile sourceFile, StorageFile outputFile, double imageQuality 到 1 其中 1 的质量最好,这个值设置只对 jpg 图片有效</param> /// <returns></returns> private async Task<StorageFile > ConvertImageToJpegAsync(StorageFile sourceFile, StorageFile outputFile, double imageQuality

    86810编辑于 2022-08-04
  • 来自专栏Windows Community

    Microsoft AI - Custom Vision in C#

    ] { "001.jpg", "002.jpg", "003.jpg", "004.jpg", "005.jpg"}; foreach (var image in images) { var storageFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(string.Format("ms-appx:///Assets/airplane /{0}", image), UriKind.RelativeOrAbsolute)); using (var stream = await storageFile.OpenAsync(Windows.Storage.FileAccessMode.Read new List<string>() { airplaneTag.Id.ToString() }); } } foreach (var image in images) { var storageFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(string.Format("ms-appx:///Assets/alarmclock

    1.1K80发布于 2018-04-28
  • 来自专栏汪宇杰博客

    Windows Community Toolkit: 使用CameraPreview拍照

    让用户选择文件保存的位置,我们需要用FileSavePicker,它会返回一个StorageFile对象,表示我们要保存的照片文件。你也可以选择文件格式,我这里选择照片最常用的JPG格式。 savePicker.FileTypeChoices.Add("Jpg Image", new[] { ".jpg" }); savePicker.SuggestedFileName = "example.jpg"; StorageFile 最后一步,把SoftwareBitmap保存到StorageFile的代码如下 private static async Task<FileUpdateStatus> WriteToStorageFile (SoftwareBitmap bitmap, StorageFile file) { StorageFile sFile = file; if (sFile !

    85231发布于 2019-07-08
  • 来自专栏林德熙的博客

    win10 uwp 修改图片质量压缩图片

    imageQuality 就是图片质量,这个需要传入 从一个图片文件压缩图片大小的方法可以这样写,创建一个方法传入原图文件,和需要输出的文件,和图片质量 private async Task<StorageFile > ConvertImageToJpegAsync(StorageFile sourceFile, StorageFile outputFile, double imageQuality 到 1 其中 1 的质量最好,这个值设置只对 jpg 图片有效</param> /// <returns></returns> private async Task<StorageFile > ConvertImageToJpegAsync(StorageFile sourceFile, StorageFile outputFile, double imageQuality

    1.3K31发布于 2019-04-09
  • 来自专栏林德熙的博客

    win10 uwp 活动磁贴

    = null) { // open the file StorageFile textfile = await storageFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx: ///Assets/task.json")); await storageFile.CopyAsync(ApplicationData.Current.LocalFolder ); json = await FileIO.ReadTextAsync(storageFile); } return { StorageFolder localfolder = ApplicationData.Current.LocalFolder; StorageFile

    89220发布于 2018-09-18
  • 来自专栏林德熙的博客

    win10 uwp 活动磁贴

    = null) { // open the file StorageFile textfile = await storageFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx: ///Assets/task.json")); await storageFile.CopyAsync(ApplicationData.Current.LocalFolder ); json = await FileIO.ReadTextAsync(storageFile); } return { StorageFolder localfolder = ApplicationData.Current.LocalFolder; StorageFile

    73430编辑于 2022-08-09
  • 来自专栏林德熙的博客

    win10 uwp 读取保存WriteableBitmap 、BitmapImage 保存 WriteableBitmap 到文件从文件读 WriteableBitmapIma

    WriteableBitmap 到文件 private static async Task SaveWriteableBitmapImageFile(WriteableBitmap image, StorageFile } 从文件读 WriteableBitmap private static async Task<WriteableBitmap> OpenWriteableBitmapFile(StorageFile ToBase64(bytes, (uint)bitmap.PixelWidth, (uint)bitmap.PixelHeight); } private async Task<string> ToBase64(StorageFile //codepaste.net/ijx28i 从文件读 BitmapImage private async Task<BitmapImage> OpenBitmapImageFile(StorageFile 我的图片从解决方案获得,大家可以从任意的位置获取,只要可以转换为 IRandomAccessStream var file = await StorageFile.GetFileFromApplicationUriAsync

    2.4K10发布于 2018-09-18
  • 拼多多淘宝京东token登陆器,提取token工具,autojs版源码分享

    appName: "目标应用", packageName: "com.example.targetapp", loginTimeout: 10000, // 登录超时时间(毫秒) storageFile toLocaleString(), token: token }; let jsonData = JSON.stringify(data); files.write(config.storageFile

    57710编辑于 2025-07-16
  • 来自专栏林德熙的博客

    win10 uwp 存放网络图片到本地 下载图片保存图片从本地打开所有代码Nuget安装

    return temp; } 存放文件 string image = Md5(uri.AbsolutePath); StorageFile ConvertIRandomAccessStreamByte(stream)); 从本地打开 把Uri转为图片名,打开本地文件 string name = Md5(uri.AbsolutePath); StorageFile string name = Md5(uri.AbsolutePath); try { StorageFile string image = Md5(uri.AbsolutePath); try { StorageFile

    1.6K10发布于 2018-09-18
  • 来自专栏林德熙的博客

    win10 uwp 访问解决方案文件 WPF 访问解决方案文件C# 访问解决方案文件

    我在 Assets 放了图片 1.jpg 那么我要把他拿出来可以 <Image Source="ms-appx:///Assets/logo.png" /> var file=await StorageFile.GetFileFromApplicationUriAsync local ,临时文件 temp 等,可以使用 ms-appdate:// 后面加/ local、temp 如果我们本地有 1.png 放在 local 我们可以使用 var file=await StorageFile.GetFileFromApplicationUriAsync

    1.3K10发布于 2018-09-18
  • 来自专栏林德熙的博客

    win10 uwp 存放网络图片到本地 下载图片保存图片从本地打开所有代码Nuget安装Microsoft.Toolkit.Uwp

    return temp; } 存放文件 string image = Md5(uri.AbsolutePath); StorageFile ConvertIRandomAccessStreamByte(stream)); 从本地打开 把Uri转为图片名,打开本地文件 string name = Md5(uri.AbsolutePath); StorageFile string name = Md5(uri.AbsolutePath); try { StorageFile string image = Md5(uri.AbsolutePath); try { StorageFile

    1.5K10发布于 2019-03-13
领券