本文整理汇总了Java中com.google.android.gms.vision.barcode.Barcode.getBoundingBox方法的典型用法代码示例。如果您正苦于以下问题:Java Barcode.getBoundingBox方法的具体用法?Java Barcode.getBoundingBox怎么用?Java Barcode.getBoundingBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.vision.barcode.Barcode
的用法示例。
在下文中一共展示了Barcode.getBoundingBox方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: draw
import com.google.android.gms.vision.barcode.Barcode; //导入方法依赖的package包/类
/**
* Draws the barcode annotations for position, size, and raw value on the supplied canvas.
*/
@Override
public void draw(Canvas canvas) {
Barcode barcode = mBarcode;
if (barcode == null) {
return;
}
// Draws the bounding box around the barcode.
RectF rect = new RectF(barcode.getBoundingBox());
rect.left = translateX(rect.left);
rect.top = translateY(rect.top);
rect.right = translateX(rect.right);
rect.bottom = translateY(rect.bottom);
canvas.drawRect(rect, mRectPaint);
// Draws a label at the bottom of the barcode indicate the barcode value that was detected.
canvas.drawText(barcode.rawValue, rect.left, rect.bottom, mTextPaint);
}
示例2: draw
import com.google.android.gms.vision.barcode.Barcode; //导入方法依赖的package包/类
/**
* Draws the barcode annotations for position, size, and raw value on the supplied canvas.
*/
@Override
public void draw(Canvas canvas) {
Barcode barcode = mBarcode;
if (barcode == null) {
return;
}
// Draws the bounding box around the barcode.
RectF rect = new RectF(barcode.getBoundingBox());
rect.left = translateX(rect.left);
rect.top = translateY(rect.top);
rect.right = translateX(rect.right);
rect.bottom = translateY(rect.bottom);
canvas.drawRect(rect, mRectPaint);
}
示例3: draw
import com.google.android.gms.vision.barcode.Barcode; //导入方法依赖的package包/类
/**
* Draws the barcode annotations for position, size, and raw value on the supplied canvas.
*/
@Override
public void draw(Canvas canvas) {
Barcode barcode = mBarcode;
if (barcode == null) {
return;
}
// Draws the bounding box around the barcode.
RectF rect = new RectF(barcode.getBoundingBox());
rect.left = translateX(rect.left);
rect.top = translateY(rect.top);
rect.right = translateX(rect.right);
rect.bottom = translateY(rect.bottom);
if (graphicOverlay.isDrawRect())
canvas.drawRect(rect, mRectPaint);
// Draws a label at the bottom of the barcode indicate the barcode value that was detected.
if (graphicOverlay.isShowText())
canvas.drawText(barcode.rawValue, rect.left, rect.bottom, mTextPaint);
}
示例4: draw
import com.google.android.gms.vision.barcode.Barcode; //导入方法依赖的package包/类
/**
* Draws the barcode annotations for position, size, and raw value on the supplied canvas.
*/
@Override
public void draw(Canvas canvas) {
Barcode barcode = this.barcode;
if (barcode == null) {
return;
}
// draws the bounding box around the barcode
RectF rect = new RectF(barcode.getBoundingBox());
rect.left = translateX(rect.left);
rect.top = translateY(rect.top);
rect.right = translateX(rect.right);
rect.bottom = translateY(rect.bottom);
canvas.drawRect(rect, rectPaint);
// draws a label at the bottom of the barcode indicate the barcode value that was detected
canvas.drawText(barcode.rawValue, rect.left, rect.bottom, textPaint);
}
示例5: draw
import com.google.android.gms.vision.barcode.Barcode; //导入方法依赖的package包/类
/**
* Draws the barcode annotations for position, size, and raw value on the supplied canvas.
*/
@Override
public void draw(Canvas canvas) {
Barcode barcode = mBarcode;
if (barcode == null) {
return;
}
// Draws the bounding box around the barcode.
RectF rect = new RectF(barcode.getBoundingBox());
rect.left = translateX(rect.left);
rect.top = translateY(rect.top);
rect.right = translateX(rect.right);
rect.bottom = translateY(rect.bottom);
canvas.drawRect(rect, mRectPaint);
}
示例6: getViewBoundingBox
import com.google.android.gms.vision.barcode.Barcode; //导入方法依赖的package包/类
private RectF getViewBoundingBox(Barcode barcode) {
// Draws the bounding box around the barcode.
RectF rect = new RectF(barcode.getBoundingBox());
rect.left = translateX(rect.left);
rect.top = translateY(rect.top);
rect.right = translateX(rect.right);
rect.bottom = translateY(rect.bottom);
return rect;
}
示例7: draw
import com.google.android.gms.vision.barcode.Barcode; //导入方法依赖的package包/类
/**
* Draws the barcode annotations for position, size, and raw value on the supplied canvas.
*/
@Override
public void draw(Canvas canvas) {
Barcode barcode = mBarcode;
if (barcode == null) {
return;
}
// Draws the bounding box around the barcode.
RectF rect = new RectF(barcode.getBoundingBox());
rect.left = translateX(rect.left);
rect.top = translateY(rect.top);
rect.right = translateX(rect.right);
rect.bottom = translateY(rect.bottom);
//canvas.drawRect(rect, mRectPaint);
/**
* Draw the top left corner
*/
canvas.drawLine(rect.left - mCorderPadding, rect.top, rect.left + mCornerWidth, rect.top, mRectPaint);
canvas.drawLine(rect.left, rect.top, rect.left, rect.top + mCornerWidth, mRectPaint);
/**
* Draw the bottom left corner
*/
canvas.drawLine(rect.left, rect.bottom, rect.left, rect.bottom - mCornerWidth, mRectPaint);
canvas.drawLine(rect.left - mCorderPadding, rect.bottom, rect.left + mCornerWidth, rect.bottom, mRectPaint);
/**
* Draw the top right corner
*/
canvas.drawLine(rect.right + mCorderPadding, rect.top, rect.right - mCornerWidth, rect.top, mRectPaint);
canvas.drawLine(rect.right, rect.top, rect.right, rect.top + mCornerWidth, mRectPaint);
/**
* Draw the bottom right corner
*/
canvas.drawLine(rect.right + mCorderPadding, rect.bottom, rect.right - mCornerWidth, rect.bottom, mRectPaint);
canvas.drawLine(rect.right, rect.bottom, rect.right, rect.bottom - mCornerWidth, mRectPaint);
// Draws a label at the bottom of the barcode indicate the barcode value that was detected.
canvas.drawText(barcode.displayValue, rect.left, rect.bottom + 100, mTextPaint);
}