Подскажите пожалуйста, вот загрузил в ImageView шейп круг с обводкой:
public static void customView(View v, int backgroundColor, int borderColor) {
GradientDrawable shape = new GradientDrawable();
shape.setShape(GradientDrawable.OVAL);
shape.setCornerRadii(new float[] { 8, 8, 8, 8, 0, 0, 0, 0 });
shape.setColor(backgroundColor);
shape.setStroke(3, borderColor);
v.setBackground(shape);
}
........
ImageView image_view = (ImageView) this.findViewById(R.id.image_view);
customView(image_view, Color.parseColor("#00ff00"),Color.parseColor("#ff0000"));
Как мне из этого image_view получить Bitmap?
Вот этот код сразу вылетает:
Bitmap bm = ((BitmapDrawable) image_view.getDrawable()).getBitmap();