← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #700491]: Converting Image Object to Screen Object

 

Question #700491 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/700491

Nano Stray posted a new comment:
I was very lucky to have found out the answer by myself. I still don't
know why this works but here's the solution:

You can convert Image variable to Buffered Image by using the .get()
function

CUT_OUT_IMAGE= Image(CAPTURED_IMAGE).getSub(CUT_OUT_REGION)  #This gives back an Image variable
BUFFERED_IMAGE= CUTOUT_iMAGE.get() #converts Image variable to Buffered Image

FILE_PATH=  os.path.dirname(getBundlePath()) + "\\test.png"  #this is a sikuli project directory
ImageIO.write(BUFFERED_IMAGE, "png", File(FILE_PATH)); #

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