求一个是个五人以上姐妹头像的系列头像

请问:这个头像似乎是一系列的,叫什么呢?求其它的!?
&img src=&/cbfabafd87a79_b.png& data-rawheight=&1024& data-rawwidth=&1024& class=&origin_image zh-lightbox-thumb& width=&1024& data-original=&/cbfabafd87a79_r.png&&&img src=&/eee_b.png& data-rawheight=&433& data-rawwidth=&434& class=&origin_image zh-lightbox-thumb& width=&434& data-original=&/eee_r.png&&&br&&img src=&/6fb4ff52ac_b.png& data-rawheight=&440& data-rawwidth=&440& class=&origin_image zh-lightbox-thumb& width=&440& data-original=&/6fb4ff52ac_r.png&&
按投票排序
动漫 四月是你的谎言
不好意思 我不知道 我偶然看见觉得可爱就拿来用了....等其他人解答吧 建议你可以用百度搜图试下超萌的
已有帐号?
无法登录?
社交帐号登录本周好评内容会员榜
友情链接联系:QQandroid开源系列:CircleImageView自定义圆形控件的使用 - 推酷
android开源系列:CircleImageView自定义圆形控件的使用
1.自定义圆形控件github地址:
/hdodenhof/CircleImageView
主要的类:
package de.hdodenhof.
import edu.njupt.zhb.main.R;
import android.content.C
import android.content.res.TypedA
import android.graphics.B
import android.graphics.BitmapS
import android.graphics.C
import android.graphics.C
import android.graphics.M
import android.graphics.P
import android.graphics.RectF;
import android.graphics.S
import android.graphics.drawable.BitmapD
import android.graphics.drawable.ColorD
import android.graphics.drawable.D
import android.util.AttributeS
import android.widget.ImageV
public class CircleImageView extends ImageView {
private static final ScaleType SCALE_TYPE = ScaleType.CENTER_CROP;
private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888;
private static final int COLORDRAWABLE_DIMENSION = 1;
private static final int DEFAULT_BORDER_WIDTH = 0;
private static final int DEFAULT_BORDER_COLOR = Color.BLACK;
private final RectF mDrawableRect = new RectF();
private final RectF mBorderRect = new RectF();
private final Matrix mShaderMatrix = new Matrix();
private final Paint mBitmapPaint = new Paint();
private final Paint mBorderPaint = new Paint();
private int mBorderColor = DEFAULT_BORDER_COLOR;
private int mBorderWidth = DEFAULT_BORDER_WIDTH;
private Bitmap mB
private BitmapShader mBitmapS
private int mBitmapW
private int mBitmapH
private float mDrawableR
private float mBorderR
private boolean mR
private boolean mSetupP
public CircleImageView(Context context) {
super(context);
public CircleImageView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
public CircleImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
super.setScaleType(SCALE_TYPE);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView, defStyle, 0);
mBorderWidth = a.getDimensionPixelSize(R.styleable.CircleImageView_border_width, DEFAULT_BORDER_WIDTH);
mBorderColor = a.getColor(R.styleable.CircleImageView_border_color, DEFAULT_BORDER_COLOR);
a.recycle();
if (mSetupPending) {
mSetupPending =
public ScaleType getScaleType() {
return SCALE_TYPE;
public void setScaleType(ScaleType scaleType) {
if (scaleType != SCALE_TYPE) {
throw new IllegalArgumentException(String.format(&ScaleType %s not supported.&, scaleType));
protected void onDraw(Canvas canvas) {
if (getDrawable() == null) {
canvas.drawCircle(getWidth() / 2, getHeight() / 2, mDrawableRadius, mBitmapPaint);
canvas.drawCircle(getWidth() / 2, getHeight() / 2, mBorderRadius, mBorderPaint);
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
public int getBorderColor() {
return mBorderC
public void setBorderColor(int borderColor) {
if (borderColor == mBorderColor) {
mBorderColor = borderC
mBorderPaint.setColor(mBorderColor);
invalidate();
public int getBorderWidth() {
return mBorderW
public void setBorderWidth(int borderWidth) {
if (borderWidth == mBorderWidth) {
mBorderWidth = borderW
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
mBitmap = getBitmapFromDrawable(drawable);
public void setImageResource(int resId) {
super.setImageResource(resId);
mBitmap = getBitmapFromDrawable(getDrawable());
private Bitmap getBitmapFromDrawable(Drawable drawable) {
if (drawable == null) {
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
if (drawable instanceof ColorDrawable) {
bitmap = Bitmap.createBitmap(COLORDRAWABLE_DIMENSION, COLORDRAWABLE_DIMENSION, BITMAP_CONFIG);
bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), BITMAP_CONFIG);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
} catch (OutOfMemoryError e) {
private void setup() {
if (!mReady) {
mSetupPending =
if (mBitmap == null) {
mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
mBitmapPaint.setAntiAlias(true);
mBitmapPaint.setShader(mBitmapShader);
mBorderPaint.setStyle(Paint.Style.STROKE);
mBorderPaint.setAntiAlias(true);
mBorderPaint.setColor(mBorderColor);
mBorderPaint.setStrokeWidth(mBorderWidth);
mBitmapHeight = mBitmap.getHeight();
mBitmapWidth = mBitmap.getWidth();
mBorderRect.set(0, 0, getWidth(), getHeight());
mBorderRadius = Math.min((mBorderRect.height() - mBorderWidth) / 2, (mBorderRect.width() - mBorderWidth) / 2);
mDrawableRect.set(mBorderWidth, mBorderWidth, mBorderRect.width() - mBorderWidth, mBorderRect.height() - mBorderWidth);
mDrawableRadius = Math.min(mDrawableRect.height() / 2, mDrawableRect.width() / 2);
updateShaderMatrix();
invalidate();
private void updateShaderMatrix() {
float dx = 0;
float dy = 0;
mShaderMatrix.set(null);
if (mBitmapWidth * mDrawableRect.height() & mDrawableRect.width() * mBitmapHeight) {
scale = mDrawableRect.height() / (float) mBitmapH
dx = (mDrawableRect.width() - mBitmapWidth * scale) * 0.5f;
scale = mDrawableRect.width() / (float) mBitmapW
dy = (mDrawableRect.height() - mBitmapHeight * scale) * 0.5f;
mShaderMatrix.setScale(scale, scale);
mShaderMatrix.postTranslate((int) (dx + 0.5f) + mBorderWidth, (int) (dy + 0.5f) + mBorderWidth);
mBitmapShader.setLocalMatrix(mShaderMatrix);
自定义的属性:res/values/attrs.xml
&?xml version=&1.0& encoding=&utf-8&?&
&resources&
&declare-styleable name=&CircleImageView&&
&attr name=&border_width& format=&dimension& /&
&attr name=&border_color& format=&color& /&
&/declare-styleable&
&/resources&
使用时的布局文件:
&?xml version=&1.0& encoding=&utf-8&?&
&LinearLayout xmlns:android=&/apk/res/android&
xmlns:app=&/apk/res-auto&
android:layout_width=&match_parent&
android:layout_height=&match_parent&
android:orientation=&vertical& &
&RelativeLayout
android:layout_width=&match_parent&
android:layout_height=&0dp&
android:layout_weight=&1&
android:padding=&@dimen/base_padding&
android:background=&@color/light&&
&de.hdodenhof.circleimageview.CircleImageView
android:layout_width=&160dp&
android:layout_height=&160dp&
android:layout_centerInParent=&true&
android:src=&@drawable/demo&
app:border_width=&2dp&
app:border_color=&@color/dark& /&
&/RelativeLayout&
&RelativeLayout
android:layout_width=&match_parent&
android:layout_height=&0dp&
android:layout_weight=&1&
android:padding=&@dimen/base_padding&
android:background=&@color/dark&&
&de.hdodenhof.circleimageview.CircleImageView
android:layout_width=&160dp&
android:layout_height=&160dp&
android:layout_centerInParent=&true&
android:src=&@drawable/lena&
app:border_width=&2dp&
app:border_color=&@color/light& /&
&/RelativeLayout&
&/LinearLayout&
Demo下载:http://download.csdn.net/detail/nuptboyzhb/7284553
注意:有些开发者可能也发现了,如果我们需要一个圆形的ImageButton的话,其实,我们没有必要自己写。如果ImageButton的图标是固定不变的,我们完全可以让设计师给我设计一个圆形的图片,然后直接设置再ImageButton上就可以了。但是,请注意,我们这里的圆形ImageView是自定义控件,也即是:无论你设置的图片是什么样的,显示出来的就是圆的。比如:易信中用户头像的设置,无论用户拍什么的照片,显示出来都是一个圆的。
已发表评论数()
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
没有分页内容
图片无法显示
视频无法显示
与原文不一致

我要回帖

更多关于 贴吧头像240 240以上 的文章

 

随机推荐