English 中文(简体)
a. 绘制图像规模,以全面筛选
原标题:set image size to full screen in android

I m having an android app in which I m taking a picture using the android camera. This picture is taken in the activity A and after that is sent to activity B where is edited.

这就是我如何在<代码>B上获得我的形象:

Bundle extras = getIntent().getExtras();
BitmapFactory.Options options=new BitmapFactory.Options();
        options.inSampleSize = 5;
        byte[] imageData = extras.getByteArray("imageData");
        Bitmap myImage = BitmapFactory.decodeByteArray(imageData , 0, imageData.length,options);

        Matrix mat=new Matrix();
        mat.postRotate(90);
        bitmapResult = Bitmap.createBitmap(myImage, 0, 0, myImage.getWidth(), myImage.getHeight(), mat, true); 
 ImageView imageView = (ImageView) findViewById(R.id.myPic);
        imageView.setImageBitmap(bitmapResult);

您可以看到Im轮值bitmap。 我收到90份。

Matrix mat=new Matrix();
            mat.postRotate(90);

这里是我的<条码>,在Xml文档中:

<ImageView  
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_gravity="center"
    android:id="@+id/myPic"
    />

我面临的问题是,我的照片并非完全照相......它充满了满腔,但并非tir。 你可以在这里看到:

“entergraph

如果你能够帮助我增加小幅的面积,我真的会想一下。 增 编

EDIT:I 大麻只增加了我的形象。 工作!

最佳回答

你们也许必须树立形象。 由于图像并非完全高,图像的宽度按比例缩小,因此,双方的黑色地带。

更具体地说,使用电话摄像机拍摄的图像可能是为了准确适应屏幕,即图像的宽度-载体比率=屏幕的宽度-载荷比例。 然而,在你看来,图像的高度受顶端的纽芬兰人的限制,因此为了保持图像的血缘比例,图像的宽度按比例缩小。

问题回答

Please refer to setScaleType

You could use CENTER_CROP to get full screen image and maintain the image s aspect ratio.





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签