Closed sweet2o09 closed 6 years ago
这个功能需要修改类CropImageView draw方法中
`// 绘制黑色背景 backUpRect.set(0, 0, w, cropRect.top); backLeftRect.set(0, cropRect.top, cropRect.left, cropRect.bottom); backRightRect.set(cropRect.right, cropRect.top, w, cropRect.bottom); backDownRect.set(0, cropRect.bottom, w, h);
canvas.drawRect(backUpRect, mBackgroundPaint);
canvas.drawRect(backLeftRect, mBackgroundPaint);
canvas.drawRect(backRightRect, mBackgroundPaint);
canvas.drawRect(backDownRect, mBackgroundPaint);
// 绘制四个控制点
int radius = CIRCLE_WIDTH >> 1;
leftTopCircleRect.set(cropRect.left - radius, cropRect.top - radius,
cropRect.left + radius, cropRect.top + radius);
rightTopCircleRect.set(cropRect.right - radius, cropRect.top - radius,
cropRect.right + radius, cropRect.top + radius);
leftBottomRect.set(cropRect.left - radius, cropRect.bottom - radius,
cropRect.left + radius, cropRect.bottom + radius);
rightBottomRect.set(cropRect.right - radius, cropRect.bottom - radius,
cropRect.right + radius, cropRect.bottom + radius);
`
canvas.drawRect(...) 来实现
好的,十分感谢,已经实现
你好,我想问下,我想修改你的裁剪框样式,你的只有4个小圆点,我想顺便画一个框把4个圆点连接起来,但是不知道要怎么画