需要帮助将图像从数据库检索到MFC项目中 [英] Need help retrieving image from database into MFC project
问题描述
大家好...
我在SQL Server数据库中有一个表图像,该图像具有两列ID和图像(数据类型图像).我已将图像保存在SQL Server数据库中.现在我想从数据库中检索它并显示在mfc项目中.我正在使用DSN较少连接的ADO记录集.
我有一个想法,您必须将jpeg作为字节数组复制到MemoryStream.从该流中,您将能够加载JPEG."
但是我如何在MFC中将JPEG从数据库复制到内存strem.
请帮助...
从重新发布从SQL Server服务器数据库获取图像 [
Hi all...
I have a table image in SQL server database having two columns ID and Image (Datatype image). I have saved an image in SQL server database. Now i want to retrieve it from database and display in mfc project.I am using ADO recordset with DSN less connection.
I have an idea that "you have to copy the jpeg as bytearray to a MemoryStream. From that stream yo shall be able to load the JPEG."
but how i can copy JPEG from database to memory strem in mfc.
Pls Help...
Repost from How-to-get-image-from-SQL-server-database-into-MFC[^]
推荐答案
将图像写入文件,然后使用SHLoadImageFile将图像加载到图片控件.
Write the image to a file and load the image using SHLoadImageFile to a picture control.
这篇关于需要帮助将图像从数据库检索到MFC项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!