Featured post
layout - How to make a resolution independent camera preview on android? -
i'm making android 1.6 app uses phone's camera.
in order app resolution independent, need set compatible aspect ratio previewing camera on surfacelayout. in 1.6 sdk there no way supported sizes camera preview. possible use 4:3 or 3:2 aspect ratio , no errors whith that?
on other hand, need way make xml layout represents surfacelayout in (unknown) aspect ratio in every resolution. assume not possible change surfacelayout size in runtime. can "dp" units? other way making layout programmatically?
there apps vignette or android camera application tricks make that, black bars (vignette) or fixed buttons bar, don't know how in kind of resolution.
any ideas?
thanks!
in 1.6 sdk there no way supported sizes camera preview.
there is. can them in parsing preview-size-values
camera parameter.
string supportedsizesstring = parameters.get("preview-size-values"); list<size> supportedsizes = new arraylist<size>(); if (supportedsizesstring != null && supportedsizesstring.length() > 0) { stringsplitter ss = new textutils.simplestringsplitter(','); ss.setstring(supportedsizesstring); (string supportedsize : ss) { string[] dimentions = supportedsize.split("x"); if (dimentions.length > 1) { size size = mcamera.new size(integer.parseint(dimentions[0]), integer.parseint(dimentions[1])); supportedsizes.add(size); } } }
- Get link
- X
- Other Apps
Comments
Post a Comment