Frage

Is there any way to edit the images somehow, for example add a watermark to the image right before it is cached? So, that each time the View(GridView in my case) refreshes itself, the watermark is not added again and again in the instantiateItem method of the adapter, that adds lag to the whole process.

Optional read: I am scrambling the pictures(just like a jigsaw puzzle) that are taken using my camera app. They are stored on the SD Card but because of the scrambling, the user cannot use the picture from the gallery and he is forced to use my app which de-scrambles the images on runtime and shows the right image to the user. This process lets me offer a free to try model for my app, and the pictures can be used outside if the user pays up for the app.

The problem is, everything works fine except in the gridview for the gallery. What happens is every time an image is selected using a long-press(for editing etc), the gridview refreshes itself and all the images reload and are therefore decrypted again, this adds additional lag to the loading and the overall user experience deteriorates. Is there any way I can just decrypt the images before caching them so that this doesnt happen?

War es hilfreich?

Lösung

First of all you should create your own implementation of BitmapProcessor.

If you want to process images before saving into disc cache then use ImageLoaderConfiguration..discCacheExtraOptions(..., processor). Processing will be executed for every image before saving on disk.

If you want to process images before saving into memory cache then use DisplayImageOptions.preProcessor(processor). Processing will be executed for tasks which will got options with this processor.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top