Big Thanks timovjl
I finally tracked down the real problem
Your latest offering of my two files combined with your tweaks still just refused to work on my Dell Axim WM5
'While' loop would not perform at all whilst count was asked to .... count. No set pixels no count no nothing.
Take count out and it worked.
Turned out that this line was the problem
l = (hr * 0.3 + hg * 0.59 + hb * 0.11);
So-:
Doing the multiplication seperately and it works as in ...
l =Test(hr,hg,hb);
static int Test(BYTE hr, BYTE hg, BYTE hb)
{
hr=hr*0.3; hg= hg* 0.59;hb=hb * 0.11;
return(hr + hg + hb ); // seperate addition
}
Even with the function bracketed it would not work
as in
l = ((hr * 0.3) + (hg * 0.59) + (hb * 0.11));
Assume it overwrote some memory somewhere
It does now work and is now counting pixels for me
Thanks for your help Much appreciated
Gromit.