forked from mylhyl/Android-Zxing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hupei
committed
Aug 25, 2016
1 parent
b65d95c
commit 81485b4
Showing
15 changed files
with
118 additions
and
300 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ | |
* @author [email protected] (Daniel Switkin) | ||
*/ | ||
final class ViewfinderView extends View { | ||
|
||
private static final int CURRENT_POINT_OPACITY = 0xA0; | ||
private static final int MAX_RESULT_POINTS = 20; | ||
private static final int POINT_SIZE = 6; | ||
|
@@ -182,8 +183,8 @@ private void drawFrameCorner(Canvas canvas, Rect frame) { | |
// 左上角 | ||
canvas.drawRect(frame.left - laserFrameCornerWidth, frame.top, frame.left, frame.top | ||
+ laserFrameCornerLength, paint); | ||
canvas.drawRect(frame.left - laserFrameCornerWidth, frame.top - laserFrameCornerWidth, frame.left | ||
+ laserFrameCornerLength, frame.top, paint); | ||
canvas.drawRect(frame.left - laserFrameCornerWidth, frame.top - laserFrameCornerWidth | ||
, frame.left + laserFrameCornerLength, frame.top, paint); | ||
// 右上角 | ||
canvas.drawRect(frame.right, frame.top, frame.right + laserFrameCornerWidth, | ||
frame.top + laserFrameCornerLength, paint); | ||
|
@@ -224,15 +225,17 @@ private void drawLaserLine(Canvas canvas, Rect frame) { | |
if (laserLineResId == 0) { | ||
paint.setStyle(Paint.Style.FILL); | ||
paint.setColor(laserColor);// 设置扫描线颜色 | ||
canvas.drawRect(frame.left, laserLineTop, frame.right, laserLineTop + laserLineHeight, paint); | ||
canvas.drawRect(frame.left, laserLineTop, frame.right | ||
, laserLineTop + laserLineHeight, paint); | ||
} else { | ||
if (laserLineBitmap == null)//图片资源文件转为 Bitmap | ||
laserLineBitmap = BitmapFactory.decodeResource(getResources(), laserLineResId); | ||
int height = laserLineBitmap.getHeight();//取原图高 | ||
//网格图片 | ||
if (isLaserGridLine) { | ||
RectF dstRectF = new RectF(frame.left, frame.top, frame.right, laserLineTop); | ||
Rect srcRect = new Rect(0, (int) (height - dstRectF.height()), laserLineBitmap.getWidth(), height); | ||
Rect srcRect = new Rect(0, (int) (height - dstRectF.height()) | ||
, laserLineBitmap.getWidth(), height); | ||
canvas.drawBitmap(laserLineBitmap, srcRect, dstRectF, paint); | ||
} | ||
//线条图片 | ||
|
@@ -241,7 +244,8 @@ private void drawLaserLine(Canvas canvas, Rect frame) { | |
if (laserLineHeight == Scanner.dp2px(getContext(), DEFAULT_LASER_LINE_HEIGHT)) { | ||
laserLineHeight = laserLineBitmap.getHeight() / 2; | ||
} | ||
Rect laserRect = new Rect(frame.left, laserLineTop, frame.right, laserLineTop + laserLineHeight); | ||
Rect laserRect = new Rect(frame.left, laserLineTop, frame.right | ||
, laserLineTop + laserLineHeight); | ||
canvas.drawBitmap(laserLineBitmap, null, laserRect, paint); | ||
} | ||
} | ||
|
@@ -345,7 +349,8 @@ public void setLaserFrameCornerWidth(int laserFrameCornerWidth) { | |
this.laserFrameCornerWidth = Scanner.dp2px(getContext(), laserFrameCornerWidth); | ||
} | ||
|
||
public void setDrawText(String text, int textSize, int textColor, boolean isBottom, int textMargin) { | ||
public void setDrawText(String text, int textSize, int textColor | ||
, boolean isBottom, int textMargin) { | ||
if (!TextUtils.isEmpty(text)) | ||
drawText = text; | ||
if (textSize > 0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
zxingscanner/src/main/java/com/mylhyl/zxing/scanner/camera/FrontLightMode.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.