Mateen
asked on
Compare 2 bitmap image.
In pb7, is it possible to compare two bitmap images to verify if they are identical or not?
ASKER
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.bm p"
The normal "Select col_x into :filename1 from .....etc" or something else.
Thanks
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.bm
The normal "Select col_x into :filename1 from .....etc" or something else.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
long flen, bytes_read
blob b, tot_b1,tot_b2
li_filenum=fileopen(filena
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
bytes_read=fileread(li_fil
tot_b1=tot_b1+b
next
fileclose(li_filenum)
li_filenum=fileopen(filena
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
bytes_read=fileread(li_fil
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