We help IT Professionals succeed at work.

New podcast episode! Our very own Community Manager, Rob Jurd, gives his insight on the value of an online community. Listen Now!

x

# Compare 2 bitmap image.

on
627 Views
In pb7, is it possible to compare two bitmap images to verify if they are identical or not?
Comment
Watch Question

## View Solution Only

Commented:
Hi!

You can read the two images into a blob variable an compare them to determinate if they are identical or not

To read the file into a blob variable do this:
string filename1,filename2
integer li_filenum, loops, i
blob b, tot_b1,tot_b2

if flen>32765 then
if mod(flen,32765)=0 then
loops=flen/32765
else
loops=(flen/32765)+1
end if
else
loops=1
end if
for i=1 to loops
tot_b1=tot_b1+b
next
fileclose(li_filenum)

if flen>32765 then
if mod(flen,32765)=0 then
loops=flen/32765
else
loops=(flen/32765)+1
end if
else
loops=1
end if
for i=1 to loops
tot_b2=tot_b2+b
next
fileclose(li_filenum)

if tot_b1=tot_b2 then
messagebox("","The files are identical")
else
messagebox("","The files are diferente")
end if

Cheers from Mexico

Commented:
Hi tsiraku1

That's it.

Say, the images are saved into SQL2K table  table_x, column col_x. Then, how, this should be replaced.

filename1="C:\temp\capw.bmp"

The normal "Select col_x into :filename1 from .....etc"  or something else.

Thanks
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
Unlock the solution to this question.