Click here to Skip to main content
11,796,393 members (70,423 online)
Rate this: bad
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 at 24-May-12 1:23am
Which database you're using??
s_mon at 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
0 Maciej Los 530
1 Abhinav S 392
2 OriginalGriff 340
3 CPallini 269
4 KrunalRohit 249
0 OriginalGriff 2,012
1 Maciej Los 1,725
2 KrunalRohit 1,310
3 CPallini 1,055
4 ppolymorphe 858

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 24 May 2012
Copyright © CodeProject, 1999-2015
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