Android.Widget.ImageView.SetImageResource Method
Sets a drawable as the content of this ImageView.

Syntax

[Android.Runtime.Register("setImageResource", "(I)V", "GetSetImageResource_IHandler")]
public virtual void SetImageResource (int resId)

Parameters

resId
the resource identifier of the drawable

Remarks

Sets a drawable as the content of this ImageView.

This does Bitmap reading and decoding on the UI thread, which can cause a latency hiccup. If that's a concern, consider using ImageView.SetImageDrawable(Android.Graphics.Drawables.Drawable) or ImageView.SetImageBitmap(Android.Graphics.Bitmap) and Android.Graphics.BitmapFactory instead.

[Android Documentation]

Requirements

Namespace: Android.Widget
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1