android.widget.ImageView.setImageURI()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(442)

本文整理了Java中android.widget.ImageView.setImageURI()方法的一些代码示例,展示了ImageView.setImageURI()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.setImageURI()方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:setImageURI

ImageView.setImageURI介绍

暂无

代码示例

代码示例来源:origin: android-cjj/Android-MaterialRefreshLayout

@Override
final public void setImageURI(Uri uri) {
  super.setImageURI(uri);
}

代码示例来源:origin: Aspsine/SwipeToLoadLayout

@Override
final public void setImageURI(Uri uri) {
  super.setImageURI(uri);
}

代码示例来源:origin: facebook/facebook-android-sdk

protected void onPostExecute(Bitmap result) {
    if (result != null) {
      photoThumbnail.setImageBitmap(result);
    } else {
      // If we fail just try to set the image from the uri
      photoThumbnail.setImageURI(photoUri);
    }
  }
}

代码示例来源:origin: aa112901/remusic

@Override
  protected void onPostExecute(Void aVoid) {
    for (int i = 0; i < 7; i++) {
      imageViewList.get(i).setImageURI(Uri.parse(imageNet.get(i)));
    }
  }
}.execute();

代码示例来源:origin: hdodenhof/CircleImageView

@Override
public void setImageURI(Uri uri) {
  super.setImageURI(uri);
  initializeBitmap();
}

代码示例来源:origin: stackoverflow.com

File imgFile = new  File(“filepath”);
 if(imgFile.exists())
 {
   ImageView myImage = new ImageView(this);
   myImage.setImageURI(Uri.fromFile(imgFile));
 }

代码示例来源:origin: koral--/android-gif-drawable

/**
 * Sets the content of this GifImageView to the specified Uri.
 * If uri destination is not a GIF then {@link android.widget.ImageView#setImageURI(android.net.Uri)}
 * is called as fallback.
 * For supported URI schemes see: {@link android.content.ContentResolver#openAssetFileDescriptor(android.net.Uri, String)}.
 *
 * @param uri The Uri of an image
 */
@Override
public void setImageURI(Uri uri) {
  if (!GifViewUtils.setGifImageUri(this, uri)) {
    super.setImageURI(uri);
  }
}

代码示例来源:origin: lygttpod/SuperTextView

@Override
public void setImageURI(Uri uri) {
  super.setImageURI(uri);
  initializeBitmap();
}

代码示例来源:origin: jiangqqlmj/FastDev4Android

@Override
public void setImageURI(Uri uri) {
  super.setImageURI(uri);
  if (null != mAttacher) {
    mAttacher.update();
  }
}

代码示例来源:origin: igreenwood/SimpleCropView

/**
 * Set image uri
 *
 * @param uri source image local uri
 */
@Override public void setImageURI(Uri uri) {
 mIsInitialized = false;
 super.setImageURI(uri);
 updateLayout();
}

代码示例来源:origin: wangdan/AisenWeiBo

public void setImageURI(Uri uri) {
  super.setImageURI(uri);
  update();
}

代码示例来源:origin: jdamcd/android-crop

private void handleCrop(int resultCode, Intent result) {
  if (resultCode == RESULT_OK) {
    resultView.setImageURI(Crop.getOutput(result));
  } else if (resultCode == Crop.RESULT_ERROR) {
    Toast.makeText(this, Crop.getError(result).getMessage(), Toast.LENGTH_SHORT).show();
  }
}

代码示例来源:origin: aa112901/remusic

@Override
public void setImageURI(Uri uri) {
  super.setImageURI(uri);
  mBitmap = ((BitmapDrawable) getDrawable()).getBitmap();
  make(mBitmap);
}

代码示例来源:origin: Bearded-Hen/Android-Bootstrap

@Override public void setImageURI(Uri uri) {
  super.setImageURI(uri);
  this.sourceBitmap = getBitmapForView();
  updateImageState();
}

代码示例来源:origin: vinc3m1/RoundedImageView

@Override public void setImageURI(Uri uri) {
 super.setImageURI(uri);
 setImageDrawable(getDrawable());
}

代码示例来源:origin: ArthurHub/Android-Image-Cropper

@Override
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {

  // handle result of CropImageActivity
  if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {
   CropImage.ActivityResult result = CropImage.getActivityResult(data);
   if (resultCode == RESULT_OK) {
    ((ImageView) findViewById(R.id.quick_start_cropped_image)).setImageURI(result.getUri());
    Toast.makeText(
        this, "Cropping successful, Sample: " + result.getSampleSize(), Toast.LENGTH_LONG)
      .show();
   } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {
    Toast.makeText(this, "Cropping failed: " + result.getError(), Toast.LENGTH_LONG).show();
   }
  }
 }
}

代码示例来源:origin: naman14/Timber

@Override
public void setImageURI(Uri uri) {
  super.setImageURI(uri);
  mBitmap = getBitmapFromDrawable(getDrawable());
  setup();
}

代码示例来源:origin: steelkiwi/cropiwa

@Override
@SuppressWarnings("ConstantConditions")
protected void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_view_image);
  Uri imageUri = getIntent().getParcelableExtra(EXTRA_IMAGE);
  ImageView image = (ImageView) findViewById(R.id.image);
  image.setImageURI(imageUri);
  Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  toolbar.setTitle("");
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
public void setImageURI(Uri uri) {
  super.setImageURI(uri);
  mBitmap = getBitmapFromDrawable(getDrawable());
  setup();
}

代码示例来源:origin: cymcsg/UltimateAndroid

@Override
public void setImageURI(Uri uri) {
  super.setImageURI(uri);
  // Extract a Bitmap out of the drawable & set it as the main shader
  image = drawableToBitmap(getDrawable());
  if(canvasSize > 0)
    updateBitmapShader();
}

相关文章

ImageView类方法