Thanks Tim & Ben,

U guys are great! I got the "for loop problem" solved!

My another problem is, if I am not wrong, I can not allocate more than
64K of memory in my code right!

Now, I am capturing a 320*240 image and in order to convert it to gray
scale and store the result I have to declare something like this,

UInt8 *grayedImage = (UInt8*) MemPtrNew((320*240)* sizeof(UInt8));

Currently I am doing this and it doesn't generate any error or exception
but it doesn't give me proper data so I assume that 64K memory
limitation is playing role here. Please correct me if I am wrong!

Can anyone suggest what should I do to solve this problem?
Thanks,
Keyur.

-----Original Message-----
From: Tim Kostka [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 18, 2004 2:13 PM
To: Palm Developer Forum
Subject: Re: for loop problem!

Your variable i is UInt32 but previewWidth and previewHeight aren't.
That
means when it calculates previewWidth*previewHeight it does so as UInt16
and
gets 11264 ( = 76800 % 65536).

So cast the operation as UInt32 instead.

  for(UInt32 i=0;i<(UInt32)previewWidth*previewHeight;i++)

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



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

Reply via email to