当前位置: 首页>>代码示例>>Java>>正文


Java Barcode.getBoundingBox方法代码示例

本文整理汇总了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);
}
 
开发者ID:victoraldir,项目名称:BuddyBook,代码行数:22,代码来源:BarcodeGraphic.java

示例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);

}
 
开发者ID:Emrals,项目名称:Fuse,代码行数:20,代码来源:BarcodeGraphic.java

示例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);
}
 
开发者ID:KingsMentor,项目名称:MobileVisionBarcodeScanner,代码行数:24,代码来源:BarcodeGraphic.java

示例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);
}
 
开发者ID:tomatrocho,项目名称:insapp-android,代码行数:24,代码来源:BarcodeGraphic.java

示例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);
}
 
开发者ID:tipsi,项目名称:tipsi-barcode,代码行数:19,代码来源:BarcodeGraphic.java

示例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;
}
 
开发者ID:Credntia,项目名称:MVBarcodeReader,代码行数:11,代码来源:BarcodeGraphic.java

示例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);
}
 
开发者ID:hamzux,项目名称:cosi,代码行数:47,代码来源:BarcodeGraphic.java


注:本文中的com.google.android.gms.vision.barcode.Barcode.getBoundingBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。