android - Trouble In displaying an image -
i doing program in taking photos using camera storing in private folder.from fetching images , displaying in grid view.on clicking grid view showing fullscreen image. trouble facing when camera in portrait mode image quality perfect.but if camera in landscape mode showing streched image how can overcome this.
hi have @ below code. before saving captured image following process. save images in portrait mode. hope you.
int rotation = -1; rotation = ((windowmanager)getsystemservice(context.window_service)) .getdefaultdisplay().getorientation(); matrix rotator = new matrix(); switch (rotation) { case (surface.rotation_0): break; case (surface.rotation_90): rotator.postrotate(270); break; case (surface.rotation_180): rotator.postrotate(180); break; case (surface.rotation_270): rotator.postrotate(90); break; // screen_{width,height} applied before rotate, don't // need change them based on rotation. bmp_ss = bitmap.createbitmap(bmp_ss, 0, 0, screen_width, screen_height, rotator, false);
Comments
Post a Comment