Hi there,

Thanks for the response about Treo 600 system reset problem.
This one is again in Treo 600.
Earlier I was capturing image using 160*120 resolution and it works fine
.
Now when I am trying to use 640*480 resultion I am getting fatal
exception.

Following is the code that works for previewWidth=160, previewHeight=120
and
doesn't work for 640*480.

Bitmap *bitmapP =
BmpCreate(previewWidth,previewHeight,previewDepth,0,&err);
        
        if (bitmapP)
        {
          bmpData = (UInt16 *) BmpGetBits (bitmapP);

          // Capturing the image 
          err = CameraLibPreview (gLibRefNum, bmpData, 
                  kCameraImageFormatRGB16, previewWidth, previewHeight);
                  
          if (! err)
          {
                  WinDrawBitmap (bitmapP, previewLeft, previewTop);
          }
          else
          {
                FrmCustomAlert(ErrorAlert, "Capture Error:", NULL,
NULL);
          }
        }
        
        UInt8 result = GetGrayedImage(bmpData);
...........

UInt8 GetGrayedImage()
{
        UInt16 i;

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

                Avg = (Red+Green+Blue)/3;               
                ..............
        }       
}

The application crashes right in the above loop.
I think I am not getting enough data in *bmpData.

Please help,
Thanks,


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

Reply via email to