在C#Windows应用程序中存储图像 [英] Storing images in C# Windows application

查看:71
本文介绍了在C#Windows应用程序中存储图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我正在开发支持局域网上多个用户的Windows应用程序.在要存储和检索的数据中有图片,因此:
我应该将它们存储在数据库(SQL Server)中,还是仅将它们的路径存储在数据库中并将图像存储在HD上?

还有我应该选择哪种图像格式(JPEG,PNG等)?




感谢很多
Samer

hello,
i am developing windows application supporting several users on LAN. among the data to be stored and retrieved is pictures, so:
should i store them inside database (SQL server), or only to store their path inside database and store images on HD?

also what image format should i choose (JPEG, PNG, etc)?




Thanks Alot
Samer

推荐答案

我投票赞成将它们存储在数据库中.如果您不需要透明度,我会使用JPG,因为它们可以压缩到更小的尺寸.
I vote that you store them in the database. If you don''t need transparency, I would use JPG because they can compress to a MUCH smaller size.


我个人认为,我会将它们放在数据库中.可能使用Filestream来更轻松地处理备份和事务(如果有兴趣,请参阅:如何将二进制数据存储和提取到文件中流列 [ ^ ]).

由于JSOP指出的尺寸,JPG作为图像格式听起来很诱人.
As a personal opinion, I would put them inside the database. Propably using Filestream to more easily handle backups and transactions (if interested, see: How to store and fetch binary data into a file stream column[^]).

JPG as the image format sounds tempting because of the size as JSOP pointed out.


我更喜欢File system.检查此链接以获取更多详细信息.是的,下面的链接是关于Web应用程序的,但是您只需稍作更改即可在Win应用程序中使用它(将图片加载到Picturebox中).
将上传的文件存储在数据库或使用ASP.NET的文件系统中 [
I prefer File system. Check this link for more details. And yes the below link is about web application but you just need minor changes to use that in win application(Loading pictures into Picturebox).
Storing Uploaded Files in a Database or in the File System with ASP.NET[^]


这篇关于在C#Windows应用程序中存储图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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