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

The following are Jave code examples for showing how to use eraseColor() 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: aos-MediaLib   File: ArtworkFactory.java   View Source Code Vote up 6 votes
public Bitmap createViewBitmap(View view, Layout textLayout, int bitmapWidth, int bitmapHeight, int vertical_align) {
	final int actualBitmapWidth = getPowerOfTwo(bitmapWidth);
	final int actualBitmapHeight = getPowerOfTwo(bitmapHeight);
	Bitmap destBitmap = Bitmap.createBitmap( actualBitmapWidth, actualBitmapHeight, Bitmap.Config.ARGB_8888 );
	destBitmap.eraseColor(Color.TRANSPARENT);

	synchronized (mCanvas) {
		mCanvas.setBitmap(destBitmap);
		mCanvas.save();

		// Center the bitmap horizontally inside the "powerOfTwo" texture bitmap
           mCanvas.translate((actualBitmapWidth - bitmapWidth) / 2, 0);

		// Align vertically depending of the argument
		switch (vertical_align) {
		case ALIGN_BOTTOM:
			mCanvas.translate(0,actualBitmapHeight - bitmapHeight);
			break;
		case ALIGN_TOP:
			break;
		case ALIGN_CENTER:
		default:
			mCanvas.translate(0, (actualBitmapHeight - bitmapHeight) / 2);
		}

		view.draw(mCanvas);
           if (textLayout != null) {
               // Draw the text using the TextLayout if one is provided
               mCanvas.translate(0, (actualBitmapHeight - bitmapHeight) / 2);
               textLayout.draw(mCanvas);
           }

		mCanvas.restore();
	}
	return destBitmap;
}
 
Example 2
Project: mupdf-android-viewer-old   File: MuPDFPageView.java   View Source Code Vote up 6 votes
protected CancellableTaskDefinition<Void, Void> getUpdatePageTask(final Bitmap bm, final int sizeX, final int sizeY,
		final int patchX, final int patchY, final int patchWidth, final int patchHeight)
{
	return new MuPDFCancellableTaskDefinition<Void, Void>(mCore) {

		@Override
		public Void doInBackground(MuPDFCore.Cookie cookie, Void ... params) {
			// Workaround bug in Android Honeycomb 3.x, where the bitmap generation count
			// is not incremented when drawing.
			if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB &&
					Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH)
				bm.eraseColor(0);
			mCore.updatePage(bm, mPageNumber, sizeX, sizeY, patchX, patchY, patchWidth, patchHeight, cookie);
			return null;
		}
	};
}
 
Example 3
Project: do_PDFView   File: MuPDFPageView.java   View Source Code Vote up 6 votes
@Override
protected CancellableTaskDefinition<Void, Void> getUpdatePageTask(final Bitmap bm, final int sizeX, final int sizeY,
		final int patchX, final int patchY, final int patchWidth, final int patchHeight)
{
	return new MuPDFCancellableTaskDefinition<Void, Void>(mCore) {

		@Override
		public Void doInBackground(MuPDFCore.Cookie cookie, Void ... params) {
			// Workaround bug in Android Honeycomb 3.x, where the bitmap generation count
			// is not incremented when drawing.
			if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB &&
					Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH)
				bm.eraseColor(0);
			mCore.updatePage(bm, mPageNumber, sizeX, sizeY, patchX, patchY, patchWidth, patchHeight, cookie);
			return null;
		}
	};
}
 
Example 4
Project: PlusGram   File: Bitmaps.java   View Source Code Vote up 6 votes
public static Bitmap createBitmap(int width, int height, Bitmap.Config config) {
    Bitmap bitmap;
    if (Build.VERSION.SDK_INT < 21) {
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inDither = true;
        options.inPreferredConfig = config;
        options.inPurgeable = true;
        options.inSampleSize = 1;
        options.inMutable = true;
        byte[] array = jpegData.get();
        array[76] = (byte) (height >> 8);
        array[77] = (byte) (height & 0x00ff);
        array[78] = (byte) (width >> 8);
        array[79] = (byte) (width & 0x00ff);
        bitmap = BitmapFactory.decodeByteArray(array, 0, array.length, options);
        Utilities.pinBitmap(bitmap);
        bitmap.setHasAlpha(true);
        bitmap.eraseColor(0);
    } else {
        bitmap = Bitmap.createBitmap(width, height, config);
    }
    if (config == Bitmap.Config.ARGB_8888 || config == Bitmap.Config.ARGB_4444) {
        bitmap.eraseColor(Color.TRANSPARENT);
    }
    return bitmap;
}
 
Example 5
Project: Cable-Android   File: MotionView.java   View Source Code Vote up 5 votes
/**
 * as a side effect - the method deselects Entity (if any selected)
 * @return bitmap with all the Entities at their current positions
 */
public Bitmap getThumbnailImage() {
  selectEntity(null, false);

  Bitmap bmp = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
  // IMPORTANT: always create white background, cos if the image is saved in JPEG format,
  // which doesn't have transparent pixels, the background will be black
  bmp.eraseColor(Color.WHITE);
  Canvas canvas = new Canvas(bmp);
  drawAllEntities(canvas);

  return bmp;
}
 
Example 6
Project: GitHub   File: LruBitmapPool.java   View Source Code Vote up 5 votes
@Override
@NonNull
public Bitmap get(int width, int height, Bitmap.Config config) {
  Bitmap result = getDirtyOrNull(width, height, config);
  if (result != null) {
    // Bitmaps in the pool contain random data that in some cases must be cleared for an image
    // to be rendered correctly. we shouldn't force all consumers to independently erase the
    // contents individually, so we do so here. See issue #131.
    result.eraseColor(Color.TRANSPARENT);
  } else {
    result = Bitmap.createBitmap(width, height, config);
  }

  return result;
}
 
Example 7
Project: GitHub   File: LruBitmapPool.java   View Source Code Vote up 5 votes
@Override
@NonNull
public Bitmap get(int width, int height, Bitmap.Config config) {
  Bitmap result = getDirtyOrNull(width, height, config);
  if (result != null) {
    // Bitmaps in the pool contain random data that in some cases must be cleared for an image
    // to be rendered correctly. we shouldn't force all consumers to independently erase the
    // contents individually, so we do so here. See issue #131.
    result.eraseColor(Color.TRANSPARENT);
  } else {
    result = Bitmap.createBitmap(width, height, config);
  }

  return result;
}
 
Example 8
Project: GitHub   File: PlatformBitmapFactory.java   View Source Code Vote up 5 votes
/**
 * Creates a bitmap with the specified width and height.  Its initial density is
 * determined from the given DisplayMetrics.
 *
 * @param display Display metrics for the display this bitmap will be drawn on
 * @param width The width of the bitmap
 * @param height The height of the bitmap
 * @param config The bitmap config to create
 * @param hasAlpha If the bitmap is ARGB_8888 this flag can be used to mark the bitmap as opaque
 * Doing so will clear the bitmap in black instead of transparent
 * @param callerContext the Tag to track who create the Bitmap
 * @return a reference to the bitmap
 * @throws IllegalArgumentException if the width or height are <= 0
 * @throws TooManyBitmapsException if the pool is full
 * @throws java.lang.OutOfMemoryError if the Bitmap cannot be allocated
 */
private CloseableReference<Bitmap> createBitmap(
    DisplayMetrics display,
    int width,
    int height,
    Bitmap.Config config,
    boolean hasAlpha,
    @Nullable Object callerContext) {
  checkWidthHeight(width, height);
  CloseableReference<Bitmap> bitmapRef = createBitmapInternal(width, height, config);

  Bitmap bitmap = bitmapRef.get();
  if (display != null) {
    bitmap.setDensity(display.densityDpi);
  }

  if (Build.VERSION.SDK_INT >= 12) {
    bitmap.setHasAlpha(hasAlpha);
  }

  if (config == Bitmap.Config.ARGB_8888 && !hasAlpha) {
    bitmap.eraseColor(0xff000000);
  }

  addBitmapReference(bitmapRef.get(), callerContext);
  return bitmapRef;
}
 
Example 9
Project: FlickLauncher   File: AppWidgetManagerCompatVL.java   View Source Code Vote up 5 votes
@Override
public Bitmap getBadgeBitmap(LauncherAppWidgetProviderInfo info, Bitmap bitmap,
        int imageWidth, int imageHeight) {
    if (info.isCustomWidget || info.getProfile().equals(android.os.Process.myUserHandle())) {
        return bitmap;
    }

    // Add a user badge in the bottom right of the image.
    final Resources res = mContext.getResources();
    final int badgeMinTop = res.getDimensionPixelSize(R.dimen.profile_badge_minimum_top);

    // choose min between badge size defined for widget tray versus width, height of the image.
    // Width, height of the image can be smaller than widget tray badge size when being dropped
    // to the workspace.
    final int badgeSize = Math.min(res.getDimensionPixelSize(R.dimen.profile_badge_size),
            Math.min(imageWidth, imageHeight - badgeMinTop));
    final Rect badgeLocation = new Rect(0, 0, badgeSize, badgeSize);

    final int top = Math.max(imageHeight - badgeSize, badgeMinTop);

    if (res.getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
        badgeLocation.offset(0, top);
    } else {
        badgeLocation.offset(bitmap.getWidth() - badgeSize, top);
    }

    Drawable drawable = mPm.getUserBadgedDrawableForDensity(
            new BitmapDrawable(res, bitmap), info.getProfile(), badgeLocation, 0);

    if (drawable instanceof BitmapDrawable) {
        return ((BitmapDrawable) drawable).getBitmap();
    }

    bitmap.eraseColor(Color.TRANSPARENT);
    Canvas c = new Canvas(bitmap);
    drawable.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight());
    drawable.draw(c);
    c.setBitmap(null);
    return bitmap;
}
 
Example 10
Project: browser   File: ScreenShotUtil.java   View Source Code Vote up 5 votes
public static Bitmap capture(View view, float width, float height, boolean scroll, Bitmap.Config config) {
    if (!view.isDrawingCacheEnabled()) {
        view.setDrawingCacheEnabled(true);
    }
    if(width==0){
        width= MainApp.getInstance().getScreenWidth();
    }
    if(height==0){
        height= MainApp.getInstance().getScreenHeight();
    }

    Bitmap bitmap = Bitmap.createBitmap((int) width, (int) height, config);
    bitmap.eraseColor(Color.WHITE);
    Canvas canvas = new Canvas(bitmap);
    int left = view.getLeft();
    int top = view.getTop();
    if (scroll) {
        left = view.getScrollX();
        top = view.getScrollY();
    }
    int status = canvas.save();
    canvas.translate(-left, -top);
    float scale = width / view.getWidth();
    canvas.scale(scale, scale, left, top);
    view.draw(canvas);
    canvas.restoreToCount(status);
    Paint alphaPaint = new Paint();
    alphaPaint.setColor(Color.TRANSPARENT);
    canvas.drawRect(0f, 0f, 1f, height, alphaPaint);
    canvas.drawRect(width - 1f, 0f, width, height, alphaPaint);
    canvas.drawRect(0f, 0f, width, 1f, alphaPaint);
    canvas.drawRect(0f, height - 1f, width, height, alphaPaint);
    canvas.setBitmap(null);
    return bitmap;
}
 
Example 11
Project: PageCurl   File: CurlActivity.java   View Source Code Vote up 5 votes
private Bitmap loadBitmap(int width, int height, int index) {
	Bitmap b = Bitmap.createBitmap(width, height,
			Bitmap.Config.ARGB_8888);
	b.eraseColor(0xFFFFFFFF);
	Canvas c = new Canvas(b);
	Drawable d = getResources().getDrawable(mBitmapIds[index]);

	int margin = 7;
	int border = 3;
	Rect r = new Rect(margin, margin, width - margin, height - margin);

	int imageWidth = r.width() - (border * 2);
	int imageHeight = imageWidth * d.getIntrinsicHeight()
			/ d.getIntrinsicWidth();
	if (imageHeight > r.height() - (border * 2)) {
		imageHeight = r.height() - (border * 2);
		imageWidth = imageHeight * d.getIntrinsicWidth()
				/ d.getIntrinsicHeight();
	}

	r.left += ((r.width() - imageWidth) / 2) - border;
	r.right = r.left + imageWidth + border + border;
	r.top += ((r.height() - imageHeight) / 2) - border;
	r.bottom = r.top + imageHeight + border + border;

	Paint p = new Paint();
	p.setColor(0xFFC0C0C0);
	c.drawRect(r, p);
	r.left += border;
	r.right -= border;
	r.top += border;
	r.bottom -= border;

	d.setBounds(r);
	d.draw(c);

	return b;
}
 
Example 12
Project: mapbox-plugins-android   File: IconGenerator.java   View Source Code Vote up 5 votes
/**
 * Creates an icon with the current content and style.
 * <p/>
 * This method is useful if a custom view has previously been set, or if text content is not
 * applicable.
 */
public Bitmap makeIcon() {
  int measureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
  mContainer.measure(measureSpec, measureSpec);

  int measuredWidth = mContainer.getMeasuredWidth();
  int measuredHeight = mContainer.getMeasuredHeight();

  mContainer.layout(0, 0, measuredWidth, measuredHeight);

  if (mRotation == 1 || mRotation == 3) {
    measuredHeight = mContainer.getMeasuredWidth();
    measuredWidth = mContainer.getMeasuredHeight();
  }

  Bitmap r = Bitmap.createBitmap(measuredWidth, measuredHeight, Bitmap.Config.ARGB_8888);
  r.eraseColor(Color.TRANSPARENT);

  Canvas canvas = new Canvas(r);

  if (mRotation == 0) {
    // do nothing
  } else if (mRotation == 1) {
    canvas.translate(measuredWidth, 0);
    canvas.rotate(90);
  } else if (mRotation == 2) {
    canvas.rotate(180, measuredWidth / 2, measuredHeight / 2);
  } else {
    canvas.translate(0, measuredHeight);
    canvas.rotate(270);
  }
  mContainer.draw(canvas);
  return r;
}
 
Example 13
Project: PageCurl   File: CurlPage.java   View Source Code Vote up 5 votes
/**
 * Setter for textures.
 */
public void setTexture(Bitmap texture, int side) {
	if (texture == null) {
		texture = Bitmap.createBitmap(1, 1, Bitmap.Config.RGB_565);
		if (side == SIDE_BACK) {
			texture.eraseColor(mColorBack);
		} else {
			texture.eraseColor(mColorFront);
		}
	}
	switch (side) {
	case SIDE_FRONT:
		if (mTextureFront != null)
			mTextureFront.recycle();
		mTextureFront = texture;
		break;
	case SIDE_BACK:
		if (mTextureBack != null)
			mTextureBack.recycle();
		mTextureBack = texture;
		break;
	case SIDE_BOTH:
		if (mTextureFront != null)
			mTextureFront.recycle();
		if (mTextureBack != null)
			mTextureBack.recycle();
		mTextureFront = mTextureBack = texture;
		break;
	}
	mTexturesChanged = true;
}
 
Example 14
Project: PaoMovie   File: GifDrawable.java   View Source Code Vote up 5 votes
GifDrawable(GifInfoHandle gifInfoHandle, final GifDrawable oldDrawable,
		ScheduledThreadPoolExecutor executor,
		boolean isRenderingTriggeredOnDraw) {
	mIsRenderingTriggeredOnDraw = isRenderingTriggeredOnDraw;
	mExecutor = executor != null ? executor : GifRenderingExecutor
			.getInstance();
	mNativeInfoHandle = gifInfoHandle;
	Bitmap oldBitmap = null;
	if (oldDrawable != null) {
		synchronized (oldDrawable.mNativeInfoHandle) {
			if (!oldDrawable.mNativeInfoHandle.isRecycled()) {
				if (oldDrawable.mNativeInfoHandle.height >= mNativeInfoHandle.height
						&& oldDrawable.mNativeInfoHandle.width >= mNativeInfoHandle.width) {
					oldDrawable.shutdown();
					oldBitmap = oldDrawable.mBuffer;
					oldBitmap.eraseColor(Color.TRANSPARENT);
				}
			}
		}
	}

	if (oldBitmap == null) {
		mBuffer = Bitmap.createBitmap(mNativeInfoHandle.width,
				mNativeInfoHandle.height, Bitmap.Config.ARGB_8888);
	} else {
		mBuffer = oldBitmap;
	}

	mSrcRect = new Rect(0, 0, mNativeInfoHandle.width,
			mNativeInfoHandle.height);
	mInvalidationHandler = new InvalidationHandler(this);
	if (mIsRenderingTriggeredOnDraw) {
		mNextFrameRenderTime = 0;
	} else {
		mExecutor.execute(mRenderTask);
	}
}
 
Example 15
Project: ESPD   File: TextureCache.java   View Source Code Vote up 4 votes
public static SmartTexture createSolid(int color) {
	final String key = "1x1:" + color;

	if (all.containsKey(key)) {

		return all.get(key);

	} else {

		Bitmap bmp = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
		bmp.eraseColor(color);

		SmartTexture tx = new SmartTexture(bmp);
		all.put(key, tx);

		return tx;
	}
}
 
Example 16
Project: SmartMath   File: OGLChart.java   View Source Code Vote up 4 votes
/**
 * Draw a multiple lines text bitmap. The size of the bitmap is returned in rectTxtBox
 */
public Bitmap createTextBitmap(String text, Paint paint, com.cyzapps.VisualMFP.Color color, double dTextSize, Rect rectOrigTxtBox) {
	if (text == null)	{
		text = "";	// null pointer protection.
	}
    // First of all, calculate text bound
    int nPaintOriginalColor = paint.getColor();
    if (color != null)    {
        paint.setColor(color.getARGB());
    }    // otherwise, use paint's color.
    float fOriginalTxtSize = paint.getTextSize();
    paint.setTextSize((float) dTextSize);
    
    String[] lines = text.split("\n");
    double dSpaceBtwTxtLines = dTextSize/5.0;
    Rect rectTxtBox = calcTextBounds(text, paint, dTextSize, dSpaceBtwTxtLines);
    rectOrigTxtBox.set(rectTxtBox);
    Rect rectAdjustBox = new Rect();
    rectAdjustBox.left = 0;
    rectAdjustBox.top = 0;
    // need 2 ** integer power otherwise some devices cannot show.
    if (rectTxtBox.width() <= 0)	{
    	rectAdjustBox.right = 2;	// was 0, but createBitmap would fail if 0
    } else	{
    	rectAdjustBox.right = getNextHighestPO2(rectTxtBox.width());
    }
    if (rectTxtBox.height() <= 0)	{
    	rectAdjustBox.bottom = 2;	// was 0, but createBitmap would fail if 0
    } else	{
    	rectAdjustBox.bottom = getNextHighestPO2(rectTxtBox.height());
    }
   
    // Create an empty, mutable bitmap
    Bitmap bitmap = Bitmap.createBitmap(rectAdjustBox.width(), rectAdjustBox.height(), Bitmap.Config.ARGB_8888);
    // get a canvas to paint over the bitmap
    Canvas canvas = new Canvas(bitmap);
    bitmap.eraseColor(0);
    // get a background image from resources
    // note the image format must match the bitmap format

    Drawable background = new ColorDrawable(0x00000000);
    background.setBounds(0, 0, rectAdjustBox.width(), rectAdjustBox.height());
    background.draw(canvas); // draw the background to our bitmap
   
    float fX = 0, fY = /*rectTxtBox.height();*/-(float)paint.ascent();    // drawText's y parameter is the baseline of the character. Note that paint.ascent() is negative.
    int yOff = 0;   
    for (int i = 0; i < lines.length; ++i) {
        canvas.drawText(lines[i], fX, fY + yOff, paint);
        yOff = (int) (yOff + (int)Math.ceil(-paint.ascent() + paint.descent()) + dSpaceBtwTxtLines); // space between lines
    }

    paint.setTextSize(fOriginalTxtSize);
    paint.setColor(nPaintOriginalColor);
   
    return bitmap;
}
 
Example 17
Project: ColorBox-library   File: Utils.java   View Source Code Vote up 4 votes
static RoundedBitmapDrawable round(Resources resources, boolean isLand, int dim, int color) {

        Bitmap.Config conf = Bitmap.Config.ARGB_8888;

        int dimen = isLand ? Math.round((int) resources.getDimension(dim) * 0.85f) : (int) resources.getDimension(dim);

        Bitmap bitmap = Bitmap.createBitmap(dimen, dimen, conf);

        bitmap.eraseColor(color);

        // Create a new RoundedBitmapDrawable
        RoundedBitmapDrawable roundedBitmapDrawable = RoundedBitmapDrawableFactory.create(resources, bitmap);

        roundedBitmapDrawable.setCircular(true);

        roundedBitmapDrawable.setAntiAlias(true);

        // Return the RoundedBitmapDrawable
        return roundedBitmapDrawable;
    }
 
Example 18
Project: letv   File: DrawingCacheHolder.java   View Source Code Vote up 4 votes
private void eraseBitmap(Bitmap bmp) {
    if (bmp != null) {
        bmp.eraseColor(0);
    }
}
 
Example 19
Project: WechatChatroomHelper   File: HookLogic.java   View Source Code Vote up 3 votes
private static void handlerChatRoomBitmap(Canvas canvas, Paint paint, int size, Bitmap drawable) {
    Bitmap whiteMask = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);

    whiteMask.eraseColor(Color.WHITE);

    drawable = Bitmap.createScaledBitmap(drawable, size / 2, size / 2, false).copy(Bitmap.Config.ARGB_8888, false);

    //生成图
    Bitmap raw = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);

    Canvas bitmapCanvas = new Canvas(raw);

    //绘制logo
    bitmapCanvas.drawBitmap(drawable, size / 4, size / 4, paint);

    paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));

    //给logo染色
    bitmapCanvas.drawBitmap(whiteMask, 0, 0, paint);

    paint.setXfermode(null);


    if (AppSaveInfoUtils.INSTANCE.isCircleAvatarInfo()) {
        paint.setColor(0xFF12B7F6);
        canvas.drawCircle(size / 2, size / 2, size / 2, paint);
    } else {
        canvas.drawColor(0xFF12B7F6);
    }

    canvas.drawBitmap(raw, 0, 0, paint);

}
 
Example 20
Project: WechatChatroomHelper   File: HookLogic.java   View Source Code Vote up 2 votes
public static void handlerOfficialBitmap(Canvas canvas, Paint paint, int size, Bitmap drawable) {
    Bitmap whiteMask = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);

    whiteMask.eraseColor(Color.WHITE);

    drawable = Bitmap.createBitmap(size / 2, size / 2, Bitmap.Config.ARGB_8888);

    Canvas logoCanvas = new Canvas(drawable);

    paint.setStrokeWidth(size / 20);

    paint.setStyle(Paint.Style.STROKE);

    paint.setColor(0xFF9F289F);

    logoCanvas.drawCircle(size / 8 + size / 20, size / 4, size / 8, paint);
    logoCanvas.drawCircle(size / 2 - size / 8 - size / 20, size / 4, size / 8, paint);

    //生成图
    Bitmap raw = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);

    Canvas bitmapCanvas = new Canvas(raw);

    //绘制logo
    bitmapCanvas.drawBitmap(drawable, size / 4, size / 4, paint);

    paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));

    //给logo染色
    bitmapCanvas.drawBitmap(whiteMask, 0, 0, paint);

    paint.setXfermode(null);

    if (AppSaveInfoUtils.INSTANCE.isCircleAvatarInfo()) {
        paint.setColor(0xFFF5CB00);
        paint.setStrokeWidth(0);
        paint.setStyle(Paint.Style.FILL_AND_STROKE);
        canvas.drawCircle(size / 2, size / 2, size / 2, paint);
    } else {
        canvas.drawColor(0xFFF5CB00);
    }

    canvas.drawBitmap(raw, 0, 0, paint);

}