是否可以将粘贴图像数据复制到剪贴板,就像在桌面操作系统上一样?
Is it possible to copy&paste image data to the clipboard, like on desktop OSs?
在桌面操作系统上,在图像编辑应用程序中,您可以复制图像的一部分,然后转到另一个应用程序并粘贴它。
是否也可以在 Android 上正式支持?
如果是这样,这种功能的功能是什么?例如,可以复制的像素数是否有限制?
我发现的只是这些数据类型(链接 here):
Text - A text string. You put the string directly into the clip object,
which you then put onto the clipboard. To paste the string, you get
the clip object from the clipboard and copy the string to into your
application's storage.
URI - A Uri object representing any form of URI. This is primarily
for copying complex data from a content provider. To copy data, you
put a Uri object into a clip object and put the clip object onto the
clipboard. To paste the data, you get the clip object, get the Uri
object, resolve it to a data source such as a content provider, and
copy the data from the source into your application's storage.
Intent - An Intent. This supports copying application shortcuts. To
copy data, you create an Intent, put it into a clip object, and put
the clip object onto the clipboard. To paste the data, you get the
clip object and then copy the Intent object into your application's
memory area.
不容易。没有直接的方法来粘贴图像数据。不过,您也许可以这样做:
1)创建带有 URI 的剪辑。您需要为照片的那部分定义一个 URI
2)写一个提供图片MIME类型的content provider。
3)当请求来自第 1 部分的 URI 时,让内容提供者传递您想要粘贴的数据。
它显然不会在所有应用程序中工作,因为粘贴者需要能够理解和期望剪辑数据 URI 的图像 MIME 类型。大多数应用程序不会是我的猜测。
在桌面操作系统上,在图像编辑应用程序中,您可以复制图像的一部分,然后转到另一个应用程序并粘贴它。
是否也可以在 Android 上正式支持?
如果是这样,这种功能的功能是什么?例如,可以复制的像素数是否有限制?
我发现的只是这些数据类型(链接 here):
Text - A text string. You put the string directly into the clip object, which you then put onto the clipboard. To paste the string, you get the clip object from the clipboard and copy the string to into your application's storage.
URI - A Uri object representing any form of URI. This is primarily for copying complex data from a content provider. To copy data, you put a Uri object into a clip object and put the clip object onto the clipboard. To paste the data, you get the clip object, get the Uri object, resolve it to a data source such as a content provider, and copy the data from the source into your application's storage.
Intent - An Intent. This supports copying application shortcuts. To copy data, you create an Intent, put it into a clip object, and put the clip object onto the clipboard. To paste the data, you get the clip object and then copy the Intent object into your application's memory area.
不容易。没有直接的方法来粘贴图像数据。不过,您也许可以这样做:
1)创建带有 URI 的剪辑。您需要为照片的那部分定义一个 URI
2)写一个提供图片MIME类型的content provider。
3)当请求来自第 1 部分的 URI 时,让内容提供者传递您想要粘贴的数据。
它显然不会在所有应用程序中工作,因为粘贴者需要能够理解和期望剪辑数据 URI 的图像 MIME 类型。大多数应用程序不会是我的猜测。