Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置高亮区颜色 #71

Open
wimwu opened this issue Apr 18, 2018 · 0 comments
Open

设置高亮区颜色 #71

wimwu opened this issue Apr 18, 2018 · 0 comments

Comments

@wimwu
Copy link

wimwu commented Apr 18, 2018

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);
                        }
                    }

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant