Store Image in Memory

Asked by Jeff_Vallis on 2019-01-25

I have been storing an area of screen as an image (imageA.pnd) and then checking its position - first to see if clicking scroll bar has moved the item and where is its new position.
I then take the image again still using (imageA.pnd)
The second time I do this I believe that it is using the first image and not the second image.
e.g. if exists(imageA.pnd) ) and find(imageA.pnd)

This could be the result of the speed that my old machine is running at or maybe once it has read an image it caches it and doesnt

Is there a way that I can store an image in memory and use it in exist and find

if I didn't need the new position I could use a Region Change test

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
masuo
Solved:
2019-01-26
Last query:
2019-01-26
Last reply:
2019-01-25
Best masuo (masuo-ohara) said : #1

By default, images used once are cached.

https://sikulix-2014.readthedocs.io/en/latest/scripting.html?highlight=Cache#image-search-path-where-sikulix-looks-for-image-files
SikuliX internally manages a cache for the imagefile content (standard 64 MB), where images are held in memory, thus avoiding a reload on subsequent references to the same image file.

HowTo force the update.
https://answers.launchpad.net/sikuli/+question/483025

Jeff_Vallis (vallis-pj) said : #2

Thanks masuo, that solved my question.