title: Draw Emoji on canvas using BitmapShader
body: <p>I'm trying to draw emoji, whenever I touch the screen, I'm using <code>setShader</code> method and <code>BitmapShader</code> to make it but the code below gives this :</p>
  
  <p><a href="https://i.stack.imgur.com/Oj3eQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Oj3eQ.jpg" alt="enter image description here"></a></p>
  
  <pre><code>public class MainActivity extends Activity implements View.OnTouchListener{
  
      float downx = 0;
      float downy = 0;
      float upx = 0;
      float upy = 0;
      Canvas canvas;
      Paint paint;
      ImageView imageView;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          Point point = new Point();
          Display cureentDispaly = getWindowManager().getDefaultDisplay();
          cureentDispaly.getSize(point);
          int weidth = point.x;
          int height = point.y;
          Bitmap bitmap = Bitmap.createBitmap(weidth , height, Bitmap.Config.ARGB_8888);
          canvas = new Canvas(bitmap);
          paint = new Paint();
          paint.setAntiAlias(true);
          paint.setStrokeWidth(50);
          paint.setStyle(Paint.Style.STROKE);
          paint.setStrokeJoin(Paint.Join.ROUND);
          paint.setStrokeCap(Paint.Cap.ROUND);
          paint.setShader(new BitmapShader(BitmapFactory.decodeResource(getResources(),R.drawable.heart), Shader.TileMode.REPEAT, Shader.TileMode.REPEAT));
          paint.setStyle(Paint.Style.STROKE);
          imageView = (ImageView)findViewById(R.id.imageView);
          imageView.setImageBitmap(bitmap);
          imageView.setOnTouchListener(this);
      }
      @Override
      public boolean onTouch(View v, MotionEvent event) {
          int action = event.getAction();
          switch (action){
              case MotionEvent.ACTION_DOWN:
                  downx = event.getX();
                  downy = event.getY();
                  break;
              case MotionEvent.ACTION_MOVE:
                  upx = event.getX();
                  upy = event.getY();
                  canvas.drawLine(downx, downy, upx, upy, paint);
                  imageView.invalidate();
                  downx = upx;
                  downy = upy;
                  break;
              case MotionEvent.ACTION_UP:
                  upx = event.getX();
                  upy = event.getY();
                  canvas.drawLine(downx, downy, upx, upy, paint);
                  imageView.invalidate();
                  break;
              case MotionEvent.ACTION_CANCEL:
                  break;
              default:
                  break;
  
          }
          return true;
      }
  }
  </code></pre>
  
  <p>what I want is something similar to this <a href="http://www.i2symbol.com/draw" rel="nofollow noreferrer">Draw With Emoji</a> and this : </p>
  
  <p><a href="https://i.stack.imgur.com/PM3HM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PM3HM.jpg" alt="enter image description here"></a></p>
  
  <p>How I can draw a repetitive emoji without making it cropped</p>
  
  <p>?</p>