Hi guys,

I am getting some stupid result with for loop!
Can anyone please help me with this?

previewWidth = 320; previewHeight = 240;

for(UInt32 i=0;i<previewWidth*previewHeight;i++)
{
        Red = bmpData[i] >> 11;
        Green = (bmpData[i] & (0x07e0))>>5;
        Blue = bmpData[i] & (0x001f);   
        Avg = (Red+Green+Blue)/3;

        grayedImage[i] = ((UInt8)Avg);
}

The value of "i" outside this loop is 11,264 rather than 76,800.
It doesn't go beyond 11,264 in the loop for value of "i";

If tried to put an if(i>11264) in the for loop itself, but it never
entered that statement!

Instead of "i<previewWidth*previewHeight", I tried i<76800 but that
crashes the application!

I don't know why this is happening!

Please help!
Thanks,
Keyur.




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to