How could I resize the android camera preview dynamically? -


i programming program on android mobile. want resize camera preview dynamically fail. need camera preview has size 800*800. please me!

my code :

@override public void surfacechanged(surfaceholder holder, int format, int width,int height) {     if(camera != null)     {                    camera.parameters myparameters = camera.getparameters();         mybestsize = getbestpreviewsize(width, height, myparameters);         log.i("my best camera size parameters", string.valueof(mybestsize.width)+" "+string.valueof(mybestsize.height));         myparameters.setpreviewsize(mybestsize.width, mybestsize.height);         list<string> flashmodes = myparameters.getsupportedflashmodes();         if (flashmodes.size() > 0 && flashmodes.contains(parameters.flash_mode_auto))             myparameters.setflashmode(parameters.flash_mode_auto);          camera.setparameters(myparameters);                   camera.setdisplayorientation(90);         camera.startpreview();     }    } 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -