Home > Software engineering >  VB SQL in binary image display
VB SQL in binary image display

Time:09-16

VB SQL in binary image display
Pray god to help

CodePudding user response:

In SQL has been convert image to binary
Just don't know how to operate in the b

CodePudding user response:

The first step: first the corresponding image data out of the database,

The second step: to make the "byte array" convert images,
This step, "simple" point, like PropertyBag to convert;
(but it seems only supports BMP/JPG, GIF/ico, WMF and so on minority several types, which I haven't tried,)

A little "complex", use the API to operation, but to call several API,
VB directly supports several types of images, can use OleLoadPicture () to handle;
"Newer", such as PNG image types, you need to use Gdi + function to deal with,

CodePudding user response:

A Stream in the vb ADO object Stream objects, particularly simple to operation of binary images, can store binary image, also can read has storage of binary images,

CodePudding user response:

Database design level, it is strongly recommended that you save the pictures on the outside of the database, to store images stored in the database of the relative path, the root path as a system parameter setting,

Such as your photos can be in on local D: \ \ images type1 \ a. pg and D: \ \ images type2 \ B.g if
So if your database storage type1 \ a. pg and type2 \ B.g if two relative path, the root path D: \ \ images as the system parameters, when acquiring the images retrieved relative path then spell root can directly go to pick up your object files, and there's no need to consider the data format, the processing of any format and your ordinary processing files in the same way, as for you after the storage location of the overall change, such as in a machine, the original D: \ \ images mapped to a network backup Z: the change of root parameters are solved, or into a network path http:\\www.myurl.com\images also as long as you want get some small change support network,

CodePudding user response:

This thing a lot of ah, baidu

CodePudding user response:

I have seen the images in the database project, and finally all regret, and then to the images with great cost out and refactor the code, to persuade the landlord early
  • Related