Is it possible to compare bitmaps in wxWidgets?
I mean sth like that:
bmp = new wxEmptyBitmap(0,0)
bmp2 = new wxEmptyBitmap(0,0)
bmp.LoadFile("f:/documenti/calcio.bmp", wxBITMAP_TYPE_BMP);
bmp2.LoadFile("f:/documenti/calcio2.bmp", wxBITMAP_TYPE_BMP);
and now I want sth like that
if (bmp==bmp2) {
//code
}
is there any way to compare bitmaps wxBitmap eventually images(wxImage)?
roar
compare ...wxImage or wxBitmap Topic is solved
Hi!
In addition to what ddv said, I'd firstly check the obvious parameters. Use GetHeight() and GetWidth() for example. Then either use GetData() and compare it this way, or use the GetRed(), GetGreen() and GetBlue() methods.
In addition to what ddv said, I'd firstly check the obvious parameters. Use GetHeight() and GetWidth() for example. Then either use GetData() and compare it this way, or use the GetRed(), GetGreen() and GetBlue() methods.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
In addition to the above suggestions,
If you want to do a somewhat "fuzzy" matching of the images and be able to discover similar or the same images even if they have different sizes you can calculate and compare their color histograms:
http://en.wikipedia.org/wiki/Color_histogram
Regards,
Giannis
If you want to do a somewhat "fuzzy" matching of the images and be able to discover similar or the same images even if they have different sizes you can calculate and compare their color histograms:
http://en.wikipedia.org/wiki/Color_histogram
Regards,
Giannis