开发者

Image should not lose quality and add white spaces around the image

开发者 https://www.devze.com 2023-04-05 04:22 出处:网络
Hi guys i have a bitmap with size 600*420 and i need to post the image in size 900*900..so the image is stretched.but i don\'t want it to be stretched i need that image t开发者_运维问答o add white spa

Hi guys i have a bitmap with size 600*420 and i need to post the image in size 900*900..so the image is stretched.but i don't want it to be stretched i need that image t开发者_运维问答o add white spaces and save the quality.


i think this will help you ::

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="fill_parent"
    android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"
    android:gravity="center" android:orientation="horizontal">

    <RelativeLayout 
        android:layout_width="420dp" android:layout_height="600dp"
        xmlns:android="http://schemas.android.com/apk/res/android"
        >
            <ImageView
                       android:layout_height="fill_parent "
                       android:layout_width="fill_parent "
                       android:layout_marginTop="0dp"
                       android:src="@drawable/Image"
                ></ImageView>
  </RelativeLayout>
</LinearLayout>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号