如何在Sqlite数据库中保存图片 [英] How Do I Save Pictures In Sqlite Database
本文介绍了如何在Sqlite数据库中保存图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开一家Windows应用商店。我可以使用此代码将图片保存在本地磁盘上
private async void保存(对象发送者,RoutedEventArgs e)
{
尝试
{
Windows.Storage.Pickers.FileSavePicker save = new Windows.Storage.Pickers.FileSavePicker();
save.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.Desktop;
save.DefaultFileExtension =。png;
save.FileTypeChoices.Add(PNG,new string [] {。png});
StorageFile filesave = await save.PickSaveFileAsync();
using(IOutputStream ab = await filesave.OpenAsync(FileAccessMode.ReadWrite))
{
if(ab!= null)
await m_InkManager.SaveAsync(ab);
}
}
catch(exception ex)
{
var dlge = new MessageDialog(ex.Message);
dlge.ShowAsync();
}
}
i需要更改此代码的路径和将图片保存在sq-lite数据库中
解决方案
任何努力?
CodeProject本身有一些关于这个主题的好文章。请看下面的链接,让自己先行一步......
C#& SQLite - 存储图像 [ ^ ]
http://zetcode.com/db / sqlitecsharp / images / [ ^ ]
i'm working on a windows app store. i can save pictures on the local disk with this code
private async void Save(object sender, RoutedEventArgs e) { try { Windows.Storage.Pickers.FileSavePicker save = new Windows.Storage.Pickers.FileSavePicker(); save.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.Desktop; save.DefaultFileExtension = ".png"; save.FileTypeChoices.Add("PNG", new string[] { ".png" }); StorageFile filesave = await save.PickSaveFileAsync(); using (IOutputStream ab = await filesave.OpenAsync(FileAccessMode.ReadWrite)) { if (ab != null) await m_InkManager.SaveAsync(ab); } } catch (Exception ex) { var dlge = new MessageDialog(ex.Message); dlge.ShowAsync(); } }
i need to change the path of this code and save the pictures in an sq-lite database
解决方案
Any effort?
CodeProject itself has quite some good articles on this topic. Look at below links to give yourself a head start...
C# & SQLite - Storing Images[^]
http://zetcode.com/db/sqlitecsharp/images/[^]
这篇关于如何在Sqlite数据库中保存图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文