Keyur Patwa wrote:

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);
}

Double check the sizes of bmpData[] and grayedImage[]. Maybe you have too small arrays and it causes abnormal behaviour.


Also, I'm new to PalmOS so I don't know if there is an upper limit for these kind of arrays?

Severi S.

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

Reply via email to