Professional Documents
Culture Documents
Image Library
Image Library
Image Library
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
1
Gv Võ Ngọc Đạt
Android
Picasso.get()
//.load("https://phucanhcdn.com/media/product/37380_laptop_microsoft_laptop_3_ryzen
_7_1_2.jpg")
.load(R.drawable.dellxps13)
.resize(300, 300)
.into(binding.imageView);
}
}
(https://square.github.io/picasso/)
=> Note: Applying Transformation Using Glide. If you want to apply transformation i.e.
crop, apply filter to bitmap, you can do so using Glide library. There are several in-built
transformations in glide.
2
Gv Võ Ngọc Đạt
Android
+ CenterCrop
+ FitCenter
+ CircleCrop
+) Resizing Image
If you want to resize downloaded image and then load it into view, you can do so using
.override(200, 200) method.
<ImageView
android:id="@+id/imageView"
android:layout_width="120dp"
android:layout_height="120dp"
android:contentDescription="Image Description"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
3
Gv Võ Ngọc Đạt
Android
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
4
Gv Võ Ngọc Đạt