8 Replies - 3424 Views - Last Post: 24 September 2010 - 12:50 AM Rate Topic: -----

#1 Guest_krishna*


Reputation:

image comparison

Posted 31 August 2010 - 05:22 AM

hi everbody, i am using webapplication in asp.net and c#.net .
i want to compare two images . it is possible in web application..please help me .i am new in developer side..please help me

Thanks..
Is This A Good Question/Topic? 0

Replies To: image comparison

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: image comparison

Posted 31 August 2010 - 05:31 AM

here are two snippets that show you how to compare images...

http://www.dreaminco...snippet2859.htm

http://www.dreaminco...snippet4188.htm
Was This Post Helpful? 1
  • +
  • -

#3 Guest_krishna*


Reputation:

Re: image comparison

Posted 02 September 2010 - 02:44 AM

View Posteclipsed4utoo, on 31 August 2010 - 04:31 AM, said:

here are two snippets that show you how to compare images...

http://www.dreaminco...snippet2859.htm

http://www.dreaminco...snippet4188.htm



hi,

Thanks to you.reply for my question .i have another problem if i am insert image in sqlserver my image store in binary data format only.
i want only image format how to convert binary data to image format.plz reply me...
Was This Post Helpful? 0

#4 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: image comparison

Posted 02 September 2010 - 05:07 AM

The image datatype will be removed from SQL Server. Microsoft recommends that you save it in binary format.
Was This Post Helpful? 0
  • +
  • -

#5 Guest_krishna*


Reputation:

Re: image comparison

Posted 04 September 2010 - 01:04 AM

hi, anybody please help me

i am retrieve images from database . how to display that images my image control..anyone help me..
this is my code retrieve image from DB
con.Open();
SqlCommand com = new SqlCommand("select images from ima where imgid=@imgid", con);
        com.Parameters.Add("@imgid", SqlDbType.VarChar);
        SqlDataReader dr = com.ExecuteReader();
        if (dr.Read())
        {

            Image2.Imageurl   = dr["images"].ToString();
            Context.Response.BinaryWrite((byte[])dr["images"]);
        }
        Response.Write("image retrive");
        con.Close();

Thanks..

This post has been edited by JackOfAllTrades: 06 September 2010 - 06:32 AM

Was This Post Helpful? 0

#6 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: image comparison

Posted 04 September 2010 - 07:13 AM

looking at this code

Image2.Imageurl = dr["images"].ToString();
Context.Response.BinaryWrite((byte[])dr["images"]);



Is the images column in the database a varchar(or other character type) or is it a binary field? In the first line, you are using it as a string. In the second line you are using it as a binary value. So which is it? It can't be both.
Was This Post Helpful? 0
  • +
  • -

#7 Guest_krishna*


Reputation:

Re: image comparison

Posted 06 September 2010 - 06:25 AM

hello sir,

Thanks for your reply. basicaly i am new in developer side. In my project i am store my image in DB after i am retrieve the image from DB and display the image in image control. so here i am using field as images and Datatype Image.
Plz tell me the code how to display the image in my image control..
already i stored image in DB but how to display in image control i dont know..

Thanks..
Was This Post Helpful? 0

#8 Frinavale  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 203
  • View blog
  • Posts: 776
  • Joined: 03-June 10

Re: image comparison

Posted 08 September 2010 - 12:26 PM

When the ASP.NET Image control is rendered in the browser it is an HTML <img> tag which has a "src" property that points to the URL where the image can be downloaded from by the browser...to display to the user.

So this means that the image has to be accessible for the browser to download.
When the image is stored in a database, it is not accessible.

So, to get around this problem you need to implement an ASPX page (these are accessible by the browser) which retrieves the image from the database and writes the raw image data to the Response.out stream... In other words, the aspx page doesn't return HTML, it returns image data that it retrieves from the database.

For example, you would create an ASPX page called something like "Thumbnail":
public partial class Thumbnail : System.Web.UI.Page
{
        protected void Page_Load(object sender, EventArgs e)
        {
            //change the content type (header) to "image/jpg" to
            //indicate that this is sending image data instead of html
            Response.ContentType = "image/jpg";

            //retrieve the "id" of the image from the URL so that
            //you can retrieve the correct image from the database.
            string id = Request.QueryString("ID");

            //retrieve the data and write it to the response output stream.
            selectedImageDisplay(id);
        }
 
        private void selectedImageDisplay(string id)
        {
           // in here connect to your database and retrieve the image.
           // once you have the data, write it to the Response output stream
           // using the Response.BinaryWrite(...) method.
        }
}



Then in your main aspx page, set the Image.ImageUrl property to call the URL of the "Thumbnail.aspx" page:
<asp:Image ID="theImage" ImageUrl="~/Thumbnail.aspx?ID=12345" />



-Frinny
Was This Post Helpful? 0
  • +
  • -

#9 Guest_krishna*


Reputation:

Re: image comparison

Posted 24 September 2010 - 12:50 AM

hi sorry for longtime..i want another help, i have one image(ex.cancer cell images)and i give input one sample cancer cell image.how to campare theas 2images if both images correct means give this is this type of cancer (ex.lungcancer or not) i am want only in asp.net and c#.net develp in wepapplication

pleade help with me ..urgently i want.reply code for this concept..

thanks..
Was This Post Helpful? 0

Page 1 of 1