Click here to Skip to main content
Rate this: bad
good
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 20:21pm
Comments
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
good
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);
        }
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 290
1 Jochen Arndt 165
2 DamithSL 125
3 PIEBALDconsult 110
4 Garth J Lancaster 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 24 May 2012
Copyright © CodeProject, 1999-2014
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