0

I am developing custom camera app, I am looking for some extra feature after capturing image from camera user can add text on image and can rotate,scale and move over screen.

Is there some open source library available for this.

I am trying my own custom implementation by enable user to input text in edit text then a function convert input text to bitmap and then display it to a image view with scale and move feature, but this flow is not smooth.

below is code for do so -

   Bitmap bitmap = Bitmap.createBitmap(textView.getWidth(), textView.getHeight(), Bitmap.Config.ARGB_8888);
            Canvas c = new Canvas(bitmap);
   TouchImageView iv = (TouchImageView) findViewById(R.id.touch_iv);
   iv.setImageBitmap(bitmap);

So if any one have idea about this please provide your support.

TIA

Ravi Bhandari
  • 4,682
  • 8
  • 40
  • 68

1 Answers1

0

Extend ImageView class and draw text over there , like

   class LabledImageView extends ImageView{
        float xPos,yPos;
        String text="your text";
            @Override
            protected void onDraw(Canvas canvas) {
                super.onDraw(canvas);
                if (text != null) {
                    canvas.drawText(text, xPos, yPos, mTextPaint);
                }
            }
       @Override
       public boolean onTouchEvent(MotionEvent event) {
           xPos = event.getX();
           yPos = event.getY();
           invalidate();
           return super.onTouchEvent(event);
       }
    }
shobhan
  • 1,460
  • 2
  • 14
  • 28