title: Android: drawRect without antialiasing
body: <p>I draw a rectangle on a bitmap and its borders are antialiased or have some effects as you can see:
  <img src="https://i.stack.imgur.com/TqZE9.png" alt="enter image description here"> original image: <img src="https://i.stack.imgur.com/e8WdX.png" alt="enter image description here"></p>
  
  <p>How to switch off that effect to get solid lines like this:</p>
  
  <p><img src="https://i.stack.imgur.com/KI60G.png" alt="enter image description here"> <img src="https://i.stack.imgur.com/2DP04.png" alt="enter image description here"></p>
  
  <p>I use this code:</p>
  
  <pre><code>Bitmap mBuffer = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
  gfx = new Canvas(mBuffer);
  
  Paint paintNorm = new Paint();
  paintNorm.setAntiAlias(false);
  paintNorm.setStrokeWidth(1);
  paintNorm.setStyle(Paint.Style.STROKE);
  paintNorm.clearShadowLayer();
  paintNorm.setDither(false);
  paintNorm.setFilterBitmap(false);
  
  paintNorm.setColor(0xFFA8A8A8);
  gfx.drawRect(2,3,50,50, paintNorm);
  </code></pre>