Skip to content

设置高亮区颜色 #71

@wimwu

Description

@wimwu

new BaseLightShape() {
@OverRide
protected void resetRectF4Shape(RectF viewPosInfoRectF, float dx, float dy) {
//缩小高亮控件范围
viewPosInfoRectF.inset(dx,dy);
}

                        @Override
                        protected void drawShape(Bitmap bitmap, HighLight.ViewPosInfo viewPosInfo) {
                            Canvas canvas = new Canvas(bitmap);
                            Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
                            paint.setDither(true);
                            paint.setAntiAlias(true);
                            RectF rectF = viewPosInfo.rectF;
                            canvas.drawCircle(rectF.left+(rectF.width()/2),rectF.top+(rectF.height()/2),
                                    Math.max(rectF.width(),rectF.height())/2,paint);
                            paint.setStyle(Paint.Style.STROKE);
                            paint.setColor(Color.RED);
                            paint.setStrokeWidth(ConvertUtils.dp2px(1));
                            canvas.drawCircle(rectF.left+(rectF.width()/2),rectF.top+(rectF.height()/2),
                                    Math.max(rectF.width(),rectF.height())/2 - ConvertUtils.dp2px(1),paint);
                        }
                    }

想给高亮区设置一个边框,但是发现不怎么设置都是透明色,这是为什么?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions