如何从一个画布复制到另一个 [英] How to copy from one canvas to another

查看:205
本文介绍了如何从一个画布复制到另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想复制在一个画布中绘制的图片(详情) )到另一个画布。通常讨论的使用位图的解决方案将不起作用,因为Bitmap类没有许多属于Canvas类的重要方法。有没有其他解决方案?

I want to copy the image drawn in one canvas (details) into another canvas. The commonly discussed solution of using bitmaps will not work because the Bitmap class does not have many of the important methods belonging to the Canvas class. Are there any other solutions?

推荐答案

Canvas总是用来绘制在屏幕上或Bitmap。使用Bitmaps的解决方案工作得很好:创建一个Bitmap,创建一个Canvas来绘制该Bitmap,然后将Bitmap绘制到另一个Canvas上。您还可以在图片中记录所有绘图命令,并在不同的画布上重放。

A Canvas is always used to draw either on screen or onto a Bitmap. The solution of using Bitmaps works perfectly well: create a Bitmap, create a Canvas to draw onto that Bitmap, then draw the Bitmap onto another Canvas. You also record all drawing commands in a Picture and replay them on a different Canvas.

这篇关于如何从一个画布复制到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆