2011-01-29 48 views
2

我開始在Android上,我想要學習如何做到這一點:如何讓用戶可以從手機中選擇一張照片並將圖像縮小到100x100像素?

爲了讓用戶可以按下按鈕並從手機中選擇一張照片,並在ImageView上將圖像縮小爲100x100像素我的佈局。如果可能的話,像富人爲200 KB最大

我搜索在谷歌,但我發現的信息是太難爲我,這些例子不是那些我正在尋找

如果有人可以給我的代碼做這將是巨大的,我的技能是不是洙好

這是我的佈局:

<RelativeLayout 
    android:gravity="center_vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 
    <TextView 
     android:id="@+id/profileImageLabel" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Profile Image:" 
     android:layout_marginTop="13px"/> 
    <ImageView 
     android:id="@+id/profileImage" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignBaseline="@id/profileImageLabel" 
     android:layout_alignParentRight="true" 
     android:maxWidth="90px" 
     android:maxHeight="90px"/> 
</RelativeLayout> 

回答

3

所以,走一步看一步:

  1. How to pick an image from gallery (SD Card) for my app?
  2. Crop and resize an image in Android

我的技能是不是洙好

這是可悲的,但它的東西,你應該保持個人。沒有人關心你是否熟練;更好的是你專注於提高你的谷歌搜索和編程技能,就是這樣。

+0

您的第二個鏈接不能幫助我,對不起,太難了,我沒有看到他在哪裏可以把尺寸 – NullPointerException 2011-01-29 14:43:27

相關問題