Skip to content

Commit

Permalink
Draw4: canvas.translate
Browse files Browse the repository at this point in the history
  • Loading branch information
DysaniazzZ committed Feb 22, 2018
1 parent 517ac4f commit 1666c7d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ public Practice03TranslateView(Context context, @Nullable AttributeSet attrs, in
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);

canvas.save();
canvas.translate(-100, -100);
canvas.drawBitmap(bitmap, point1.x, point1.y, paint);
canvas.restore();

canvas.save();
canvas.translate(200, 0);
canvas.drawBitmap(bitmap, point2.x, point2.y, paint);
canvas.restore();
}
}

0 comments on commit 1666c7d

Please sign in to comment.