Set image height and width android..! -


in app inserting image sdcard imageview. how can set image width=window width , image height set automatic aspect ratio.

after transform image matrix.

i using code

int height; int width;  string[] template_array; imageview imgtemplate; int position = 0;  @override protected void oncreate(bundle savedinstancestate) {     // todo auto-generated method stub     super.oncreate(savedinstancestate);     setcontentview(r.layout.gallery_image);       height = getwindowmanager().getdefaultdisplay().getheight();     width = getwindowmanager().getdefaultdisplay().getwidth();     initui();     // initpager();     displayimage();     setonclicklistners(); } 

set image view's width match_parent, height wrap_content, , scaletype centerinside. make scale keeping aspect ratio, have width of full screen, , stop scaling image such fits on screen.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -