微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android.graphics.RegionIterator的实例源码

项目:binea_project_for_android    文件BasketballView.java   
public BasketballView(Context context,AttributeSet attrs,int defStyleAttr) {
    super(context,attrs,defStyleAttr);
    WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    screenWidth = wm.getDefaultdisplay().getWidth();
    BitmapFactory.Options options = new BitmapFactory.Options();
    options.inJustDecodeBounds = true;
    BitmapFactory.decodeResource(getResources(),R.drawable.training_challenge_court_medium_active,options);
    originWidth = options.outWidth;
    originHeight = options.outHeight;

    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
    mPaint.setStyle(Paint.Style.stroke);
    mPaint.setstrokeWidth(strokeWidth);
    mPaint.setColor(Color.YELLOW);

    movalPath = new Path();
    mRectPath = new Path();

    mRectF = new RectF();

    mRegion = new Region();
    tempRegon = new Region();

    mRegionIterator = new RegionIterator(tempRegon);

    mTempRect = new Rect();

    mTextPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
    //mTextPaint.setTextAlign(Paint.Align.LEFT);
    mTextPaint.setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,28,getResources().getdisplayMetrics()));
    mTextPaint.setColor(Color.WHITE);
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。