dragdrop() slider

Asked by daniellee

i'm trying to use function drapDrop() to slide the slidebar.

my code as below:
try{
      Pattern pattern = new Pattern("img\\bdot.png").similar(0.7f);
      Region tmp = s.find(pattern);
      if (tmp != null) {
        System.out.println("img bdot already found ");
        System.out.println("X : "+tmp.getX()+" Y : "+tmp.getY()+
                           " H : "+tmp.getH()+" W : "+tmp.getW());
        s.dragDrop(tmp, Location(tmp.x + 0, tmp.y + 100));

system comeout:

C:\Sikuli>javac CTOA.java
CTOA.java:41: error: cannot find symbol
        s.dragDrop(tmp, Location(tmp.x + 0, tmp.y + 100));
                        ^
  symbol: method Location(int,int)
  location: class CTOA
1 error
 what i miss?
thanks a lot

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
daniellee
Solved:
Last query:
Last reply:
Revision history for this message
daniellee (danielli) said :
#1

and i use same code , just replace s.dragDrop(tmp,"img\\down.png");
"img\\down.png" is a image of item. it works

 but i wnat to drag the slidebar to specific location(x.y)

Revision history for this message
RaiMan (raimund-hocke) said :
#2

IMHO must be
s.dragDrop(tmp, new Location(tmp.x + 0, tmp.y + 100));

Revision history for this message
daniellee (danielli) said :
#3

it works, thank you

i want to know why~~