First define image as drawable

android.graphics.drawable.GradientDrawable gd = new android.graphics.drawable.GradientDrawable();


for background color the defined drawable set

gd.setColor(Color.parseColor(“color_code”));

for set stroke write code given below

gd.setStroke((int)3, Color.parseColor(“color_code”));

for round corner add this Code

gd.setCornerRadii(new float[]{(int)20,(int)20,(int)20,(int)20,(int)20,(int)20,(int)20,(int)20});

Now to defined gd set in the imageview

image_id.setBackground(gd);