Max, I also was trying to crop my preview to show it in a smaller space. But it would cram the whole image into the smaller view I created. I studied some of the android source code, tried and failed at many remedies, and finally settled on a tacky compromise:
1) I created a SurfaceView that fills the whole screen, and do the mCamera.setPreviewDisplay() to its surfaceHolder as you'd expect. 2) I "covered" the SurfaceView with other views set with a background color, leaving a small region to show the camera preview. I am not proud. But it delivers the proper illusion. I have to then "crop" the image in the same place after I take the picture. I would have liked to have a "ViewPort" type of view where I could have just "zoomed in" in the surface view where I wanted. Better yet if I could apply any 2D pipeline stuff from an invisible surfaceView and put the result into a visible surface view or canvas. On May 20, 3:56 pm, Max Salley <msalley....@gmail.com> wrote: > I'm trying to show a cropped version of the preview, but show it at > native resolution rather than showing the entire thing scaled down. I > discuss what I'm doing more here (http://groups.google.com/group/ > android-developers/t/f95804f843d3711b). > > On May 20, 3:50 pm, Jason Proctor <ja...@particularplace.com> wrote: > > > > > what do you want to do with the preview? > > > if you just want to render it, then Camera will do that for you with > > setPreviewDisplay(). > > > best thing to do if you want to do anything else == don't use Camera > > previews :-) > > > >I think I might go the offscreen buffer route and render when I can, > > >as FPS doesn't matter to me in the slightest. I'm looking at creating > > >a virtual canvas to draw to, but I'm not sure what to do with the > > >YCbCrarray that can get it into a usable form. What would you > > >suggest I do with the array? > > > -- > > jason.software.particle --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---