I am having trouble with drawing a bitmap to a surfaceview with the canvas.drawBitmap(Bitmap, Rect, Rect, Paint) method.
When i put somethign like this:
canvas.drawBitmap(square, new Rect(0, 0, 100, 100), new Rect(180, 130, 100, 100), mpaint);
it renders something like this:
http://s21.postimg.org/69jlkn71j/image.png
and if i put something like this:
canvas.drawBitmap(square, new Rect(0, 0, 100, 100), new Rect(50, 90, 100, 100), mpaint);
the screen looks like this:
http://s9.postimg.org/qvp9635vj/image.png
it really wear, i've tried all ways, but it doesn't work. Do yo have any idea of whats happening? has it something to do with the lockcanvas() and unlockcanvasandpost() process?
i would really aprecciate your help, i've been here for hours.
oh, i forgot to mention that when i put the square in full screen:
canvas.drawBitmap(square, new Rect(0, 0, 100, 100), new Rect(0, 0, this.getWidth(), this.getHeight()), mpaint);
it draws it just as it should be....