Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
(对安卓来说很新)
我在 Canvas 上绘制了一个位图,我想知道如何在每次启动 Activity 时让它随机显示,是否可以使用canvas.drawBitmap?
canvas.drawBitmap
我正在使用 SurfaceView,现在我有canvas.drawBitmap一个 public void render(Canvas canvas)方法。任何帮助是极大的赞赏!谢谢!
public void render(Canvas canvas)
Random random = new Random(); canvas.drawBitmap(bitmap,random.nextInt(canvas.getWidth()-bitmap.getWidth()),random.nextInt(canvas.getHeight()-bitmap.getHeight()),null);