← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #184255]: How to draw a circle or some shape using sikuli?

 

Question #184255 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/184255

dinev proposed the following answer:
Below is some sample code to draw rectangle and triangle in paint
Hope this help.

--------------------------------------------------------------------

start_point= "start_point.png"

def drawRect():
    mLoc=Env.getMouseLocation().offset(100,100)
    mouseMove(mLoc)
    mouseDown(Button.LEFT)
    mouseMove(mLoc.offset(200,0))
    mouseMove(mLoc.offset(200,100))
    mouseMove(mLoc.offset(0,100))
    mouseMove(mLoc.offset(0,0))
    mouseUp()

def drawTriang():
    mLoc=Env.getMouseLocation().offset(300,300)
    mouseMove(mLoc)
    mouseDown(Button.LEFT)
    mouseMove(mLoc.offset(200,0))
    mouseMove(mLoc.offset(100,100))
    mouseMove(mLoc.offset(0,0))
    mouseUp()

sleep(1)
switchApp("Paint")
mouseMove(start_point)
drawTriang()
mouseMove(start_point)
drawRect()

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.