PageCurl(杂志)与图像从网页图像、杂志、网页、PageCurl

2023-09-05 08:46:30 作者:最後的溫柔

我有工作的 Harism卷页(Open GL的的)的https:// github上。 COM / harism / android_page_curl 及其工作完全正常

I am working with Harism Page Curl(Open GL) https://github.com/harism/android_page_curl and its works perfectly fine

但在这个例子中,我发现的情况是,我们必须将所有的位图资源准备(下载),但我要的是形象会去加载(运行时)从网络和将高速缓存为未来的这个样子。

But in this example the condition I found is that we must have all Bitmap resource ready(downloaded) but what I want is image will going to load(runtime) from web and will be cache for future like this.

要有所了解,我将如何实现这一目标?一个小的帮助/提示也是AP preciated。 :)

Want some idea that how would I achieve this? a small help/hint is also appreciated. :)

感谢。

推荐答案

这个回答假设您希望按哈里·Smått(harism),并没有其他人使用的卷页。

This answer assumes that you want to use the Page Curl by Harri Smått (harism) and nothing else.

有不同的方式来实现与进度条等待屏幕:

There are different ways to achieve the wait screen with progress bar:

创建一个自定义视图,将显示图像的每一页。当所需的图像不可用,它会与进度条显示等待消息在下载的图像中的背景。该 BitmapProvider 通过或者使用返回此自定义视图捕获的位图(画布或使用 drawingCache )。这是应当注意的是,在 CurlView 将需要与从视图中的最新的图像进行更新每当有进行中的变化。这可以通过 requestRender 的方法来完成。 创建一个OpenGL进展部件。每当图像不可用,并需要被下载,这种进展插件连同该消息示出代替的页面。当下载完成后得到,视图重新渲染与下载的图像。 Create a custom view that will display the image for every page. When the required image is not available, it will display the wait message together with the progress bar while downloading the image in the background. The BitmapProvider returns the bitmap captured from this custom view (by either using a Canvas or using the drawingCache). What is to be noted is that the CurlView will need to be updated with the latest image from the view whenever there is a change in progress. This can be done by requestRender method. Create an OpenGL progress widget. Whenever the image is not available and need to be downloaded, this progress widget together with the message is shown in place of the page. When the download gets completed, the view is re-rendered with the downloaded image.