标签:mystra android imageview 图片转换 判断图片
本文地址:http://blog.csdn.net/caroline_wendy
if (mPhotoView.getDrawable() == null) { // Toast.makeText(getActivity(), "图片加载失败", Toast.LENGTH_SHORT).show(); mPhotoView.setImageDrawable(getResources().getDrawable(R.drawable.icon_default_user_photo)); }
ByteArrayOutputStream out = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); byte[] array= out.toByteArray();
Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
Drawable drawable = new FastBitmapDrawable(bitmap);
Canvas canvas = new Canvas(bitmap) drawable.draw(canvas)
Drawable drawable = activity.getResources().getDrawable(R.drawable.icon);
Bitmap bitmap = BitmapFactory. decodeResource (Resources res, int id)
Android - 确认ImageView的图片是否加载成功
标签:mystra android imageview 图片转换 判断图片
原文地址:http://blog.csdn.net/caroline_wendy/article/details/42704919