简体   繁体   English

将画布另存为文件,并放入滚动视图作为搜索结果

[英]Save canvas as a file and putting to scrollview as a search result

In short I would like to know how to do this: 简而言之,我想知道如何做到这一点:

Saving a canvas with all the output of label/edittext/views as an (image)file on sdcard. 将包含标签/编辑文本/视图的所有输出的画布另存为sdcard上的(图像)文件。

Using a search function, it will catch this canvas and display it on a scrollview or listview. 使用搜索功能,它将捕获此画布并将其显示在滚动视图或列表视图中。

I hope someone out there knows the answer or having a nice example of the code. 我希望那里的人知道答案或有一个不错的代码示例。

Thanks for now, JackD 现在谢谢JackD

The following code saves the canvas bitmap to a file: 以下代码将画布位图保存到文件中:

Dim Out As OutputStream
Out = File.OpenOutput(File.DirRootExternal, "Test.png", False)
Canvas1.Bitmap.WriteToStream(out, 100, "PNG")
Out.Close

You can draw the views to the canvas by using Canvas.DrawDrawable with the views background. 您可以通过将Canvas.DrawDrawable与视图背景一起使用,将视图绘制到画布上。

Not sure what you mean with the search function. 不确定搜索功能的含义。 You can later load this bitmap and display it on a ScrollView (with an ImageView) or ListView (with AddTwoLinesAndBitmap). 您以后可以加载此位图,并将其显示在ScrollView(带有ImageView)或ListView(带有AddTwoLinesAndBitmap)上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM