hi all
i am implement a application first i stored the images in binary form in ms access database using C#.
now i want to check new uploaded images is present or not in database .means comparing between two binary images
Please anyone help me
thanks in advance

Manoj BhoirPosted May 14, 2015, 2:04 AM
You can compare two binary image data in C#.
Please see this code sample :
static bool StreamEquals(Stream stream1, Stream stream2)
{
const int bufferSize = 2048;
byte[] buffer1 = new byte[bufferSize]; //buffer size
byte[] buffer2 = new byte[bufferSize];
while (true) {
int count1 = stream1.Read(buffer1, 0, bufferSize);
int count2 = stream2.Read(buffer2, 0, bufferSize);
if (count1 != count2)
return false;
if (count1 == 0)
return true;
// You might replace the following with an efficient "memcmp"
if (!buffer1.Take(count1).SequenceEqual(buffer2.Take(count2)))
return false;
}
}