RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 407 forks source link

Is there a "FitStart" Scale Type? #251

Open siralam opened 6 years ago

siralam commented 6 years ago

As far as I know there are only 2 scale types that can be configured in previewScaleType(), known as ScaleType.CenterCrop and ScaleType.CenterInside.

Now suppose I don't want my preview to be cropped (because I need to overlay something on it on a exact position). So I must use CenterInside.

The problem is, no matter I set match_parent or wrap_content to CameraView's xml, it always fill the screen, and the preview is centered in the screen. And that leaves blank area in both top and bottom space; but I need my preview to be pinned at the top.

Is this possible?

Diolor commented 6 years ago

Why not use center crop with wrap content in height?

siralam commented 6 years ago

The preview fills the screen if I use CenterCrop with wrap_content in height.

DubyOriginal commented 6 years ago

... I have the same problem