如何在VB中从SQL数据库中检索图像数据(字节)时提高应用程序性能 [英] How to improve application performance when retrieving image data(byte) from SQL data base in VB

查看:57
本文介绍了如何在VB中从SQL数据库中检索图像数据(字节)时提高应用程序性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理图像处理项目。用户可以存储多个图像并从数据库中检索。但问题需要花费大量时间从数据库检索图像数据(字节)并显示在堆栈面板图像中。



我尝试了什么:



i我根据图片检索图片用户名。

i am working on "Image Processing" Project.in which user can Store a multiple images and retrieve From Data Base.But Problem is Takes To Much Time To retrieve Image Data(Byte) from Data Base and displays in Stack Panel Image.

What I have tried:

i am retrieve the Image according to User Name.

推荐答案

我们无法帮助你:我们不知道你是如何检索图像的,你检索的图像有多少,你是什么存储它们,它们有多大,同时还有其他什么。我们甚至不知道您认为To Much Time在现实世界中,或者SQL服务器和应用PC是同一台计算机,还是通过两个锡罐和一些字符串连接!



但是...图像很大,可能非常非常大:将它们存储在数据库中可能是一个非常糟糕的主意,因为它使用大量内存和带宽来传输他们。您使用堆栈面板意味着要检索多个图像。首先,看看你在做什么,以及你在图像数据上使用了多少个进程。尝试找出瓶颈所在的位置,找出有利于节省时间的任何区域。考虑使用秒表类来为您提供准确的基线数,以确定快速和慢速。



抱歉,我们不能做任何那对你来说 - 我们看不到你的屏幕,访问你的硬盘,或读你的想法;更不用说在代码运行时计算代码!
We can't help you: we have no idea how you are retrieving the images, how many of them you are retrieving, what you are storing them as, how big they are, what else is going on at the same time. We don't even know what you consider "To Much Time" is in the real world, or if the SQL server and the app PC are the same computer, or connected via two tin cans and a bit of string!

But ... images are big, and can be very, very big: storing them in a DB can be a very bad idea as it uses a lot of memory and bandwidth to transfer them. And your use of a stackpanel implies that there is more than one image being retrieved. So start by looking at what you are doing, and how many processes you are using on the image data. Try to work out where the bottleneck is, and identify any areas which are good for time savings. Consider using the Stopwatch class to give you accurate baseline numbers to work from in establishing what is quick and what is slow.

Sorry, but we can't do any of that for you - we can't see your screen, access your HDD, or read your mind; let alone time your code while it is running!


一种常见的技术是只在文件路径中存储文件路径并将实际文件保留在文件系统上。

此外,根据您的处理算法要求,您可以转换文件(例如调整大小或减小颜色深度),以使它们更轻量级。
A common technique is storing just the file paths in the database and leave the actual files on the filesystem.
Moreover, depending on your processing algorithm requirements, you could transform the files (e.g. resize, or reduce the color depth) in order to make them more lightweight.


这篇关于如何在VB中从SQL数据库中检索图像数据(字节)时提高应用程序性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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