SetPreviewSize takes an enumeration constant like kCamLibImageSizeQVGA, while SetPreviewRect takes a rect which shows where on the screen it goes. (It doesn't have to be at the top, nor centered, but does have to be all on the screen.)

The preview rect is set in screen coordinates, not native coordinates, so a 320x240 camera preview needs a 160x120 rectangle passed to SetPreviewRect.


On Sep 17, 2007, at 5:09 PM, Stefan Mohr wrote:

I'm working off the CameraV3 sample code provided by Palm and am trying to restrict the bounds of the preview to less than full screen. This is working great on the hacked Zire 71 sim but when I try it on a Treo 700p I'm unable to see the preview screen at all.

My code is essentially doing this:
// photo lib init
RectangleType previewRect;
previewRect.bounds.topleft.x = .....
// set all preview bounds
SetPreviewRect( photoLibRefNum, &previewRect );
TurnPreviewOn( photoLibRefNum, oldPhotoLibrary );


Both the sim and device are using the "new" photo library, so it doesn't appear to be a difference in the version of the library. If I remove the SetPreviewRect() call everything works wonderfully on the device.

Any thoughts? The only other preview-related call I know I can make is SetPreviewSize() which takes an Int32. I have a feeling this is related to color depth and not preview dimensions but haven't found very good documentation on the various CamlibControl() params.

Can anyone with more experience using the camera give me any advice?


--
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to