Click here to Skip to main content
15,947,958 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
After converting a color image to black and white, I want to detect the shape of the image how i store different type of shape in to database

what are the method use identify different shape from each image
how can I store each detected shape in a database since image can not store to the database and how can i store image data to database
Prasad_Kulkarni 24-May-12 1:23am    
Which database you're using??
StM0n 24-May-12 1:52am    
Do you mean the size of the image or the shape of the content?

1 solution

you can save image in database of sql as Varbinary(Max) datatype and saving image in database. First save image at particular path than readallbyte from this image and save these byte in your database table as describe in this code:-

using System.IO;
using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Common;

private void saveImageFile(string FileNameWithPath)
            byte[] bt = null;
            if (System.IO.File.Exists(FileNameWithPath))
                bt = System.IO.File.ReadAllBytes(FileNameWithPath);

            Database DbCon = "connectionString"; 
            //Get Data from Database
            DbCommand Cmd = DbCon.GetStoredProcCommand("storeProcedureName");
            DbCon.AddInParameter(Cmd, "@ImageFile", DbType.Binary, bt);
            int a=DbCon.ExecuteNonQuery(Cmd);
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900