← Back to team overview

sikuli-driver team mailing list archive

[Question #293396]: reload image dynamically

 

New question #293396 on Sikuli:
https://answers.launchpad.net/sikuli/+question/293396

I am updating images on the fly like this:

import shutil
image = "image.png"
click(image)
new_image = capture()
spot= getBundleFolder()+"image.png" 
shutil.copyfile(new_image, spot)
click(spot) 

Is there a way to reload/overwrite/clear an image in the cache:
[debug] Image: loaded: notFound.png (file:/C:/Users/User/Desktop/dynamicImage.sikuli/image.png)
[debug] Image: cached: notFound.png (524 KB) (# 1 KB 524 -- 0 % of 64 MB)
[debug] Image: reused: notFound.png (file:/C:/Users/User/Desktop/dynamicImage.sikuli/image.png)

I realize click(new_image) works, but I'm more interested in using a string for the click spot, but I need it versitile enough to use whatever strings can be used to define the parameters of click (i.e. Pattern("image.png").similar(0.37).targetOffset(50,50)
).

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.