title: Jagged edges on images rendered in Android
body: <p>I'm currently developing my first Android app and am having some issues rendering images. The image itself is great quality to begin with, but upon rendering it the quality drastically lowers. Edges become jagged and it just looks poorly done. Everyone I've showed it to thus far has almost immediately noticed it, without any prompting about it. [start on left, end on right:]</p>
  <p><a href="https://i.stack.imgur.com/gld5A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gld5A.png" alt="Sample Image" /></a></p>
  <p>I'm trying everything I am aware of and every tip I've been able to find by looking around online, but nothing seems to fix it.</p>
  <p>Currently, I get the image as a Bitmap and scale it:</p>
  <pre><code>Bitmap holeImage = BitmapFactory.decodeResource(res, R.drawable.hole_image);
  Bitmap holeImageBMP = Bitmap.createScaledBitmap(holeImage, width, height, true);
  </code></pre>
  <p>Once I have the image, I create a Paint, set a few smoothing attributes to true, and then draw it on the canvas:</p>
  <pre><code>Paint smoothingPaint = new Paint();
  smoothingPaint.setAntiAlias(true);
  smoothingPaint.setFilterBitmap(true);
  smoothingPaint.setDither(true);
  canvas.drawBitmap(holeImageBMP, 0, 0, smoothingPaint);
  </code></pre>
  <p>Yet, as you can obviously see above, the image quality drastically decreases. I've seen plenty of images being rendered beautifully and I'm honestly just not sure what's going on so any advice would be great!</p>
  <p>Other notes: I'm using a SurfaceView method to handle the drawing, similar in nature to the LunarLander example given in the SDK.</p>
  <p>Thanks again!</p>