StickerView
StickerView copied to clipboard
Unable to draw the sticker in a specific position
I have saved bitmap and StickerPropertyModel and now i am trying to draw the sticker in a specific position
Hey Ram8948, You can set Sticker at a specific position using the below method.
public void setBitmap(Bitmap bitmap, float x, float y) {
matrix.reset();
mBitmap = bitmap;
setDiagonalLength();
initBitmaps();
int w = mBitmap.getWidth();
int h = mBitmap.getHeight();
oringinWidth = w;
float initScale = (MIN_SCALE + MAX_SCALE) / 2;
matrix.postScale(initScale, initScale, w / 2, h / 2);
positionX = x;
positionY = y;
matrix.postTranslate(x - w / 2, y - h / 2);
invalidate();
}
Add this method to StickerView class. Now you can set your bitmap with the specified position.