Click here to Skip to main content
13,055,047 members (53,129 online)
Rate this:
Please Sign up or sign in to vote.
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
Posted 23-May-12 19:21pm
Prasad_Kulkarni 24-May-12 1:23am
Which database you're using??
s_mon 24-May-12 1:52am
Do you mean the size of the image or the shape of the content?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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);

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 24 May 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100