更新时间:2023-02-13 22:58:40
要使用Glide
加载原始图像,请使用以下代码:
To load the original image using Glide
I use the code below:
Glide.with(view.getContext())
.load(pictureFile)
.asBitmap()
.into(new SimpleTarget<Bitmap>(Target.SIZE_ORIGINAL,Target.SIZE_ORIGINAL) {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation glideAnimation) {
imageView.setImageBitmap(resource);
}
});
请记住,由于设备的屏幕分辨率,浏览器中的图片在设备上可能看起来有所不同.使用此方法,您将可以使用Bitmap
对象检查像素.
另外,请记住,您的ImageView
必须具有width
和height
且具有WRAP_CONTENT
值.
Remember that the picture in browser may look different on the device due to the screen resolution of your device. Using this method you will be able to check the pixels using the Bitmap
object.
Also, keep in mind that your ImageView
must have width
and height
with WRAP_CONTENT
value.