Java Code Examples for android.graphics.Bitmap.getPixel()

The following are Jave code examples for showing how to use getPixel() of the android.graphics.Bitmap class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Ocr-android   File: BitmapUtils.java   View Source Code Vote up 6 votes
/**
 * 实现对图像进行二值化处理
 *
 * @param origin bitmap
 * @return Bitmap
 */
public static Bitmap turnBinary(Bitmap origin) {
    int width = origin.getWidth();
    int height = origin.getHeight();
    Bitmap bitmap = origin.copy(Bitmap.Config.ARGB_8888, true);
    for (int i = 0; i < width; i++) {
        for (int j = 0; j < height; j++) {
            int col = bitmap.getPixel(i, j);
            int alpha = col & 0xFF000000;
            int red = (col & 0x00FF0000) >> 16;
            int green = (col & 0x0000FF00) >> 8;
            int blue = (col & 0x000000FF);
            int gray = (int) (red * 0.3 + green * 0.59 + blue * 0.11);
            if (gray <= 95) {
                gray = 0;
            } else {
                gray = 255;
            }
            int newColor = alpha | (gray << 16) | (gray << 8) | gray;
            bitmap.setPixel(i, j, newColor);
        }
    }
    return bitmap;
}
 
Example 2
Project: GitHub   File: SlowGreyScalePostprocessor.java   View Source Code Vote up 6 votes
@Override
public void process(Bitmap bitmap) {
  final int w = bitmap.getWidth();
  final int h = bitmap.getHeight();

  for (int x = 0; x < w; x++) {
    for (int y = 0; y < h; y++) {
      /*
       * Using {@link Bitmap#getPixel} when iterating about an entire bitmap is inefficient as it
       * causes many JNI calls. This is only done here to provide a comparison to
       * {@link FasterGreyScalePostprocessor}.
       */
      final int color = bitmap.getPixel(x, y);
      bitmap.setPixel(x, y, SlowGreyScalePostprocessor.getGreyColor(color));
    }
  }
}
 
Example 3
Project: MegviiFacepp-Android-SDK   File: ConUtil.java   View Source Code Vote up 6 votes
/**
 * 获取bitmap的灰度图像
 */
public static byte[] getGrayscale(Bitmap bitmap) {
	if (bitmap == null)
		return null;

	byte[] ret = new byte[bitmap.getWidth() * bitmap.getHeight()];
	for (int j = 0; j < bitmap.getHeight(); ++j)
		for (int i = 0; i < bitmap.getWidth(); ++i) {
			int pixel = bitmap.getPixel(i, j);
			int red = ((pixel & 0x00FF0000) >> 16);
			int green = ((pixel & 0x0000FF00) >> 8);
			int blue = pixel & 0x000000FF;
			ret[j * bitmap.getWidth() + i] = (byte) ((299 * red + 587
					* green + 114 * blue) / 1000);
		}
	return ret;
}
 
Example 4
Project: Phoenicia   File: MapBlockSprite.java   View Source Code Vote up 6 votes
@Override
public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
    Bitmap maskBitmap = phoeniciaGame.spriteMasks.get(this.getTiledTextureRegion());
    // Check click mask
    if (maskBitmap != null) {
        //Debug.d("Clicked block bitmap size: " + maskBitmap.getWidth() + "x" + maskBitmap.getHeight());
        ITextureRegion maskRegion = this.getTiledTextureRegion().getTextureRegion(3);
        float texturex = maskRegion.getTextureX();
        float texturey = maskRegion.getTextureY() + maskRegion.getHeight();
        //Debug.d("Clicked block bitmap region: " + maskRegion.getWidth() + "x" + maskRegion.getHeight() + " at " + texturex + "x" + texturey);
        int maskPixel = maskBitmap.getPixel((int) (texturex + pTouchAreaLocalX), (int) (texturey - pTouchAreaLocalY)) << 32;
        //Debug.d("Clicked block pixel at " + (texturex + pTouchAreaLocalX) + "x" + (texturey - pTouchAreaLocalY) + ": " + maskPixel);
        if (maskPixel == 0) {
            // Transparent region clicked
            return false;
        }
    }

    boolean handled = this.clickDetector.onManagedTouchEvent(pSceneTouchEvent);
    return this.holdDetector.onManagedTouchEvent(pSceneTouchEvent) || handled;
}
 
Example 5
Project: react-native-sunmi-inner-printer   File: ESCUtil.java   View Source Code Vote up 6 votes
/**
 * 灰度图片黑白化,黑色是1,白色是0
 *
 * @param x   横坐标
 * @param y   纵坐标
 * @param bit 位图
 * @return
 */
public static byte px2Byte(int x, int y, Bitmap bit) {
    if (x < bit.getWidth() && y < bit.getHeight()) {
        byte b;
        int pixel = bit.getPixel(x, y);
        int red = (pixel & 0x00ff0000) >> 16; // 取高两位
        int green = (pixel & 0x0000ff00) >> 8; // 取中两位
        int blue = pixel & 0x000000ff; // 取低两位
        int gray = RGB2Gray(red, green, blue);
        if (gray < 128) {
            b = 1;
        } else {
            b = 0;
        }
        return b;
    }
    return 0;
}
 
Example 6
Project: Android-Img2Ascii   File: Img2Ascii.java   View Source Code Vote up 6 votes
public String convert(Bitmap rgbImage, int quality) {
    if(quality > 3 && quality < 1)
        quality = 3;
    String tx = "";
    int width = rgbImage.getWidth();
    int height = rgbImage.getHeight();
    for (int y = 0; y < height; y = y + quality) {
        for (int x = 0; x < width; x = x + quality) {
            int pixel = rgbImage.getPixel(x, y);
            int red = Color.red(pixel);
            int green = Color.green(pixel);
            int blue = Color.blue(pixel);

            int brightness = red + green + blue;
            brightness = round(brightness / (765 / (chars.length - 1)));
            tx += chars[brightness];
        }
        tx += "\n";
    }
    return tx;
}
 
Example 7
Project: androidthings   File: BitmapHelper.java   View Source Code Vote up 5 votes
/**
 * Converts a bitmap image to LCD screen data and sets it on the given screen at the specified
 * offset.
 * @param mScreen The OLED screen to write the bitmap data to.
 * @param xOffset The horizontal offset to draw the image at.
 * @param yOffset The vertical offset to draw the image at.
 * @param bmp The bitmap image that you want to convert to screen data.
 * @param drawWhite true for drawing only white pixels, false for drawing grayscale pixel
 * based on {@link #GRADIENT_CUTOFF}.
 */
public static void setBmpData(SSD1306 mScreen, int xOffset, int yOffset, Bitmap bmp,
                              boolean drawWhite) {
    int width = bmp.getWidth();
    int height = bmp.getHeight();
    int bmpByteSize = (int) Math.ceil((double) (width * ((height / 8) > 1 ? (height / 8) : 1)));

    // Each byte stored in memory represents 8 vertical pixels.  As such, you must fill the
    // memory with pixel data moving vertically top-down through the image and scrolling
    // across, while appending the vertical pixel data by series of 8.

    for (int y = 0; y < height; y += 8) {
        for (int x = 0; x < width; x++) {
            int bytePos = x + ((y / 8) * width);

            for (int k = 0; k < 8; k++) {
                if ((k + y < height) && (bytePos < bmpByteSize)) {
                    int pixel = bmp.getPixel(x, y + k);
                    if (!drawWhite) { // Look at Alpha channel instead
                        if ((pixel & 0xFF) > GRADIENT_CUTOFF) {
                            mScreen.setPixel(x + xOffset, y + yOffset + k, SSD1306.ColorCode.WHITE);
                        }
                    } else {
                        if (pixel == -1) { // Only draw white pixels
                            mScreen.setPixel(x + xOffset, y + yOffset + k, SSD1306.ColorCode.WHITE);
                        }
                    }
                }
            }
        }
    }
}
 
Example 8
Project: ledcontrol-androidthings   File: LedControl.java   View Source Code Vote up 5 votes
/**
 * Draw the given bitmap to the LED matrix.
 *
 * @param addr   the address of the display to control
 * @param bitmap Bitmap to draw
 * @throws IOException
 */
public void draw(int addr, Bitmap bitmap) throws IOException {
    if (addr < 0 || addr >= maxDevices) {
        return;
    }

    Bitmap scaled = Bitmap.createScaledBitmap(bitmap, 8, 8, true);
    for (int row = 0; row < 8; row++) {
        int value = 0;
        for (int col = 0; col < 8; col++) {
            value |= scaled.getPixel(col, row) == Color.WHITE ? (0x80 >> col) : 0;
        }
        setRow(addr, row, (byte) value);
    }
}
 
Example 9
Project: androidthings   File: BitmapHelper.java   View Source Code Vote up 5 votes
/**
 * Converts a bitmap image to LCD screen data and returns the screen data as bytes.
 * @param buffer The screen's data buffer.
 * @param offset The byte offset to start writing screen bitmap data at.
 * @param bmp The bitmap image that you want to convert to screen data.
 * @param drawWhite Set to true to draw white pixels, false to draw pixels based on gradient.
 * @return A byte array with pixel data for the SSD1306.
 */
public static void bmpToBytes(byte[] buffer, int offset, Bitmap bmp, boolean drawWhite) {
    int width = bmp.getWidth();
    int height = bmp.getHeight();

    // Each byte stored in memory represents 8 vertical pixels.  As such, you must fill the
    // memory with pixel data moving vertically top-down through the image and scrolling
    // across, while appending the vertical pixel data by series of 8.
    for (int y = 0; y < height; y += 8) {
        for (int x = 0; x < width; x++) {
            int bytePos = (offset + x) + ((y / 8) * width);

            for (int k = 0; k < 8; k++) {
                if ((k + y < height) && (bytePos < buffer.length)) {
                    int pixel = bmp.getPixel(x, y + k);
                    if (!drawWhite) { // Look at Alpha channel instead
                        if ((pixel & 0xFF) > GRADIENT_CUTOFF) {
                            buffer[bytePos] |= 1 << k;
                        }
                    } else {
                        if (pixel == -1) { // Only draw white pixels
                            buffer[bytePos] |= 1 << k;
                        }
                    }
                }
            }
        }
    }
}
 
Example 10
Project: anyRTC-RTCP-Android   File: QRCode.java   View Source Code Vote up 5 votes
/**
 * 比方法2的颜色黑一些
 *
 * @param text
 * @param size
 * @param mBitmap
 * @return
 */
public static Bitmap createQRCodeWithLogo4(String text, int size, Bitmap mBitmap) {
    try {
        IMAGE_HALFWIDTH = size / 10;
        Hashtable<EncodeHintType, Object> hints = new Hashtable<>();
        hints.put(EncodeHintType.CHARACTER_SET, "utf-8");

        hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
        BitMatrix bitMatrix = new QRCodeWriter().encode(text,
                BarcodeFormat.QR_CODE, size, size, hints);

        //将logo图片按martix设置的信息缩放
        mBitmap = Bitmap.createScaledBitmap(mBitmap, size, size, false);

        int[] pixels = new int[size * size];
        boolean flag = true;
        for (int y = 0; y < size; y++) {
            for (int x = 0; x < size; x++) {
                if (bitMatrix.get(x, y)) {
                    if (flag) {
                        flag = false;
                        pixels[y * size + x] = 0xff000000;
                    } else {
                        pixels[y * size + x] = mBitmap.getPixel(x, y);
                        flag = true;
                    }
                } else {
                    pixels[y * size + x] = 0xffffffff;
                }
            }
        }
        Bitmap bitmap = Bitmap.createBitmap(size, size,
                Bitmap.Config.ARGB_8888);
        bitmap.setPixels(pixels, 0, size, 0, 0, size, size);
        return bitmap;
    } catch (WriterException e) {
        e.printStackTrace();
        return null;
    }
}
 
Example 11
Project: Ocr-android   File: BitmapUtils.java   View Source Code Vote up 5 votes
/**
 * 实现对图像进行线性灰度化处理
 *
 * @param origin bitmap
 * @return Bitmap
 */
public static Bitmap lineGray(Bitmap origin) {
    int width = origin.getWidth();
    int height = origin.getHeight();
    Bitmap bitmap = origin.copy(Bitmap.Config.ARGB_8888, true);
    for (int i = 0; i < width; i++) {
        for (int j = 0; j < height; j++) {
            int col = origin.getPixel(i, j);
            int alpha = col & 0xFF000000;
            int red = (col & 0x00FF0000) >> 16;
            int green = (col & 0x0000FF00) >> 8;
            int blue = (col & 0x000000FF);
            red = (int) (1.1 * red + 30);
            green = (int) (1.1 * green + 30);
            blue = (int) (1.1 * blue + 30);
            if (red >= 255) {
                red = 255;
            }
            if (green >= 255) {
                green = 255;
            }
            if (blue >= 255) {
                blue = 255;
            }
            int newColor = alpha | (red << 16) | (green << 8) | blue;
            bitmap.setPixel(i, j, newColor);
        }
    }
    return bitmap;
}
 
Example 12
Project: airgram   File: AndroidUtilities.java   View Source Code Vote up 5 votes
public static int[] calcDrawableColor(Drawable drawable) {
    int bitmapColor = 0xff000000;
    int result[] = new int[2];
    try {
        if (drawable instanceof BitmapDrawable) {
            Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap();
            if (bitmap != null) {
                Bitmap b = Bitmaps.createScaledBitmap(bitmap, 1, 1, true);
                if (b != null) {
                    bitmapColor = b.getPixel(0, 0);
                    b.recycle();
                }
            }
        } else if (drawable instanceof ColorDrawable) {
            bitmapColor = ((ColorDrawable) drawable).getColor();
        }
    } catch (Exception e) {
        FileLog.e("tmessages", e);
    }

    double[] hsv = rgbToHsv((bitmapColor >> 16) & 0xff, (bitmapColor >> 8) & 0xff, bitmapColor & 0xff);
    hsv[1] = Math.min(1.0, hsv[1] + 0.05 + 0.1 * (1.0 - hsv[1]));
    hsv[2] = Math.max(0, hsv[2] * 0.65);
    int rgb[] = hsvToRgb(hsv[0], hsv[1], hsv[2]);
    result[0] = Color.argb(0x66, rgb[0], rgb[1], rgb[2]);
    result[1] = Color.argb(0x88, rgb[0], rgb[1], rgb[2]);
    return result;
}
 
Example 13
Project: CSipSimple   File: IcsColorDrawable.java   View Source Code Vote up 5 votes
public IcsColorDrawable(ColorDrawable drawable) {
    Bitmap bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
    Canvas c = new Canvas(bitmap);
    drawable.draw(c);
    this.color = bitmap.getPixel(0, 0);
    bitmap.recycle();
}
 
Example 14
Project: ledcontrol-androidthings   File: LedControl.java   View Source Code Vote up 5 votes
/**
 * Draw the given bitmap to the LED matrix on multiple devices.
 *
 * @param bitmap Bitmap to draw
 * @throws IOException
 */
public void draw(Bitmap bitmap) throws IOException {
    Bitmap scaled = Bitmap.createScaledBitmap(bitmap, 8 * maxDevices, 8, true);
    for (int row = 0; row < 8; row++) {
        for (int curDevice = 0; curDevice < maxDevices; curDevice++) {
            int value = 0;
            for (int col = 0; col < 8; col++) {
                value |= scaled.getPixel((curDevice * 8) + col, row) == Color.WHITE ? (0x80 >> col) : 0;
            }
            setRow(maxDevices - curDevice - 1, row, (byte) value);
        }
    }
}
 
Example 15
Project: AwesomeQRCode   File: AwesomeQRCode.java   View Source Code Vote up 5 votes
private static void binarize(Bitmap bitmap, int threshold) {
    int r, g, b;
    for (int y = 0; y < bitmap.getHeight(); y++) {
        for (int x = 0; x < bitmap.getHeight(); x++) {
            int color = bitmap.getPixel(x, y);
            r = (color >> 16) & 0xFF;
            g = (color >> 8) & 0xFF;
            b = color & 0xFF;
            float sum = 0.30f * r + 0.59f * g + 0.11f * b;
            bitmap.setPixel(x, y, sum > threshold ? Color.WHITE : Color.BLACK);
        }
    }
}
 
Example 16
Project: ESPD   File: ItemSprite.java   View Source Code Vote up 5 votes
public static int pick(int index, int x, int y) {
	Bitmap bmp = TextureCache.get(Assets.ITEMS).bitmap;
	int rows = bmp.getWidth() / SIZE;
	int row = index / rows;
	int col = index % rows;
	return bmp.getPixel(col * SIZE + x, row * SIZE + y);
}
 
Example 17
Project: zxing_qrcode_demo   File: EncodingHandler.java   View Source Code Vote up 4 votes
/**
 * Create QRCode Bitmap
 *
 * @param text content
 * @param w    Width
 * @param h    Height
 * @param logo Logo Bitmap
 * @return QRCode Bitmap [Bitmap]
 */
public static Bitmap createImage(String text, int w, int h, Bitmap logo) {
    if (TextUtils.isEmpty(text)) {
        return null;
    }
    try {
        Bitmap scaleLogo = getScaleLogo(logo, w, h);

        int offsetX = w / 2;
        int offsetY = h / 2;

        int scaleWidth = 0;
        int scaleHeight = 0;
        if (scaleLogo != null) {
            scaleWidth = scaleLogo.getWidth();
            scaleHeight = scaleLogo.getHeight();
            offsetX = (w - scaleWidth) / 2;
            offsetY = (h - scaleHeight) / 2;
        }
        Hashtable<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>();
        hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
        //Fault tolerance level. MAX
        hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
        //Set the width of the blank margin.
        hints.put(EncodeHintType.MARGIN, 0);
        BitMatrix bitMatrix = new QRCodeWriter().encode(text, BarcodeFormat.QR_CODE, w, h, hints);
        int[] pixels = new int[w * h];
        for (int y = 0; y < h; y++) {
            for (int x = 0; x < w; x++) {
                if (x >= offsetX && x < offsetX + scaleWidth && y >= offsetY && y < offsetY + scaleHeight) {
                    int pixel = scaleLogo.getPixel(x - offsetX, y - offsetY);
                    if (pixel == 0) {
                        if (bitMatrix.get(x, y)) {
                            pixel = 0xff000000;
                        } else {
                            pixel = 0xffffffff;
                        }
                    }
                    pixels[y * w + x] = pixel;
                } else {
                    if (bitMatrix.get(x, y)) {
                        pixels[y * w + x] = 0xff000000;
                    } else {
                        pixels[y * w + x] = 0xffffffff;
                    }
                }
            }
        }
        Bitmap bitmap = Bitmap.createBitmap(w, h,
                Bitmap.Config.ARGB_8888);
        bitmap.setPixels(pixels, 0, w, 0, 0, w, h);
        return bitmap;
    } catch (WriterException e) {
        e.printStackTrace();
    }
    return null;
}
 
Example 18
Project: HL4A   File: 点九图绘画.java   View Source Code Vote up 4 votes
public 点九图绘画(Bitmap $图片) {
		int w = $图片.getWidth();
		int h = $图片.getHeight();
		int c=Color.BLACK;
		int x1=0;
		int x2=0;
		for (int i=0;i < w;i++) {
				if ($图片.getPixel(i, 0) == c) {
						x1 = i;
						break;
				}
		}
		if (x1 == 0 || x1 == w - 1)
				throw new IllegalArgumentException("not found x1");
		for (int i=x1;i < w;i++) {
				if ($图片.getPixel(i, 0) != c) {
						x2 = w - i;
						break;
				}
		}
		if (x2 == 0 || x2 == 1)
				throw new IllegalArgumentException("not found x2");

		int y1=0;
		int y2=0;
		for (int i=0;i < h;i++) {
				if ($图片.getPixel(0, i) == c) {
						y1 = i;
						break;
				}
		}
		if (y1 == 0 || y1 == h - 1)
				throw new IllegalArgumentException("not found y1");
		for (int i=y1;i < h;i++) {
				if ($图片.getPixel(0, i) != c) {
						y2 = h - i;
						break;
				}
		}
		if (y2 == 0 || y2 == 1)
				throw new IllegalArgumentException("not found y2");

		init($图片, x1, y1, x2, y2);
}
 
Example 19
Project: react-native-sunmi-inner-printer   File: ESCUtil.java   View Source Code Vote up 4 votes
public static byte[] decodeBitmap(byte[] bitmapBytes) {

    Bitmap bmp = BitmapFactory.decodeByteArray(bitmapBytes, 0, bitmapBytes.length);

    int zeroCount = bmp.getWidth() % 8;
    String zeroStr = "";
    if (zeroCount > 0) {
        for (int i = 0; i < (8 - zeroCount); i++) {
            zeroStr = zeroStr + "0";
        }
    }

    List<String> list = new ArrayList<>();
    for (int i = 0; i < bmp.getHeight(); i++) {
        StringBuilder sb = new StringBuilder();
        for (int j = 0; j < bmp.getWidth(); j++) {
            int color = bmp.getPixel(j, i);

            int r = (color >> 16) & 0xff;
            int g = (color >> 8) & 0xff;
            int b = color & 0xff;

            // if color close to white,bit='0', else bit='1'
            if (r > 160 && g > 160 && b > 160)
                sb.append("0");
            else
                sb.append("1");
        }
        if (zeroCount > 0) {
            sb.append(zeroStr);
        }

        list.add(sb.toString());
    }

    List<String> bmpHexList = binaryListToHexStringList(list);
    List<String> commandList = new ArrayList<>();
    commandList.addAll(bmpHexList);

    return hexList2Byte(commandList);
}
 
Example 20
Project: QrCode   File: QrCodeHelper.java   View Source Code Vote up 4 votes
public static void createImage(final String text, final int w, final int h, final Bitmap logo, final ICreateQRCode iCreateQRCode) {
    if (TextUtils.isEmpty(text)) {
        if (iCreateQRCode != null) {
            iCreateQRCode.onCallbackBitmap(null);
        }
    } else {

        final Runnable runnable = new Runnable() {
            @Override
            public void run() {
                try {
                    Bitmap e = getScaleLogo(logo, w, h);
                    int offsetX = w / 2;
                    int offsetY = h / 2;
                    int scaleWidth = 0;
                    int scaleHeight = 0;
                    if (e != null) {
                        scaleWidth = e.getWidth();
                        scaleHeight = e.getHeight();
                        offsetX = (w - scaleWidth) / 2;
                        offsetY = (h - scaleHeight) / 2;
                    }

                    Hashtable hints = new Hashtable();
                    hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
                    hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
                    hints.put(EncodeHintType.MARGIN, Integer.valueOf(0));
                    BitMatrix bitMatrix = (new QRCodeWriter()).encode(text, BarcodeFormat.QR_CODE, w, h, hints);
                    int[] pixels = new int[w * h];

                    for (int bitmap = 0; bitmap < h; ++bitmap) {
                        for (int x = 0; x < w; ++x) {
                            if (x >= offsetX && x < offsetX + scaleWidth && bitmap >= offsetY && bitmap < offsetY + scaleHeight) {
                                int pixel = e.getPixel(x - offsetX, bitmap - offsetY);
                                if (pixel == 0) {
                                    if (bitMatrix.get(x, bitmap)) {
                                        pixel = -16777216;
                                    } else {
                                        pixel = -1;
                                    }
                                }

                                pixels[bitmap * w + x] = pixel;
                            } else if (bitMatrix.get(x, bitmap)) {
                                pixels[bitmap * w + x] = -16777216;
                            } else {
                                pixels[bitmap * w + x] = -1;
                            }
                        }
                    }
                    final Bitmap mBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
                    mBitmap.setPixels(pixels, 0, w, 0, 0, w, h);

                    callbackMainLooper(new Runnable() {
                        @Override
                        public void run() {
                            if (iCreateQRCode != null) {
                                iCreateQRCode.onCallbackBitmap(mBitmap);
                            }
                        }
                    });
                } catch (WriterException var15) {
                    var15.printStackTrace();
                    callbackMainLooper(new Runnable() {
                        @Override
                        public void run() {
                            if (iCreateQRCode != null) {
                                iCreateQRCode.onCallbackBitmap(null);
                            }
                        }
                    });
                }
            }
        };
    }
}