EqImage

EqImage.aspx


<%@ Page language="c#" Src="Reference.cs" %>
<script runat="server">
void Button1_Click(Object sender, EventArgs e) {

Image1.ImageUrl = txtUrl1.Text;
Image1.Width= new Unit( "211px" );
Image1.Height= new Unit( "188px" );
Image2.ImageUrl = txtUrl2.Text;
Image2.Width= new Unit( "211px" );
Image2.Height= new Unit( "188px" );

Quisque.CEqImage c = new Quisque.CEqImage();
double res = c.Compare( txtUrl1.Text, txtUrl2.Text );
lblOutput.Text = "Distance = " + System.Convert.ToString( res );
if ( res == 0 ) {
lblOutput.Text += "<BR>Images are identical !";
} else if ( res == -1 ) {
lblOutput.Text += "<BR>Images not loaded !";
}
}
</script>
<HTML>
<body bgcolor="#CC9966">
<form method="post" runat="server">
<h2>EqImage client ( url comparison )</h2>
<asp:Panel ID="pnlLogin" runat="server">
<TABLE width="500" bgColor="#efefef">
<tr>
<td bgcolor="#02027a" colspan="2"><font color="white">&nbsp;</font></td>
</tr>
<TR>
<TD><B>Url 1 ( ex: http://www.domain.com/image1.jpg )</B></TD>
<TD><asp:TextBox id="txtUrl1" Runat="server"></asp:TextBox></TD>
</TR>
<TR>
<TD><B>Url 2 ( ex: http://www.domain.com/image2.jpg )</B></TD>
<TD><asp:TextBox id="txtUrl2" Runat="server"></asp:TextBox></TD>
</TR>
</TABLE>
<BR>
<p>
<asp:Image id="Image1" runat="server" Width="0px" Height="0px"></asp:Image>
<asp:Image id="Image2" runat="server" Width="0px" Height="0px"></asp:Image>
</p>
<asp:Button id="btnSubmit" onclick="Button1_Click" runat="server" Text="Compare"></asp:Button><BR>
<BR><asp:Label id="lblOutput" Runat="server"></asp:Label>
</asp:Panel>
</form>
</body>
</HTML>