gpt4 book ai didi

android - 如何让用户可以从手机中选择一张照片并显示缩小到 100x100 像素的图像?

转载 作者:搜寻专家 更新时间:2023-11-01 09:15:47 25 4
gpt4 key购买 nike

我开始使用 android,我想学习这样做:

让用户可以按下一个按钮并从手机中选择一张照片,并在我的布局的 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>

最佳答案

所以,一步一步来:

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

my skills are not soo good

这很可悲,但这是您应该保密的事情。没有人在乎你是否熟练;你最好专注于提高你的谷歌搜索和编程技能,仅此而已。

关于android - 如何让用户可以从手机中选择一张照片并显示缩小到 100x100 像素的图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4837189/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com