AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi How draw password on remote smartphone with mouse?
Thema durchsuchen
Ansicht
Themen-Optionen

How draw password on remote smartphone with mouse?

Ein Thema von flashcoder · begonnen am 28. Aug 2018 · letzter Beitrag vom 3. Sep 2018
 
flashcoder

Registriert seit: 10. Nov 2013
83 Beiträge
 
#1

How draw password on remote smartphone with mouse?

  Alt 28. Aug 2018, 03:37
Delphi-Version: 10 Seattle
I'm working in a remote assistence software to android smartphones and i wish draw the password (similar to Team View for mobile) using the mouse and onmousemove event (or other event) of a Image component (that is where the remote screen is showed).

I'm using this Delphi code below but happens a detour on trajetory and draw a wrong password.
The image in attachment and video (following link) show how this is in pratice.

DEMOSTRATION IN VIDEO

Someone have some idea how solve this trouble?

Delphi-Quellcode:
TForm2 = class(TForm)
    procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    procedure Image1MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
   PO,LP: TPoint;
   draw: boolean;
  public
    { Public declarations }
  end;

procedure TForm2.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
 PO.X:= X;
 PO.Y:= Y;
 LP.X:= X;
 LP.Y:= Y;
 draw:= true;
// Canvas.Pen.Mode:= pmNotXor;
end;

procedure TForm2.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
 
 if draw then
 
  begin
  
   if (LP.X <> PO.X) or (LP.Y <> PO.Y) then
    begin

    { Canvas.MoveTo(PO.X,PO.Y);
     Canvas.LineTo(LP.X,LP.Y); }

    end;
   
   LP.X:= X;
   LP.Y:= Y;

   { Canvas.MoveTo(PO.X,PO.Y);
   Canvas.LineTo(LP.X,LP.Y); }

  end;
end;

procedure TForm2.Image1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin

// Sending throught Socket: PO.X, PO.Y, LP.X, LP.Y

 if draw then draw:= false;
end;
SocketBackgroungService class:

Code:
if (xline.contains("swipescreen")) {

    String coordenates = xline.replace("swipescreen", "");

    String[] tokens = coordenates.split(Pattern.quote("<|>"));

    float x1 = parseFloat(tokens[0]);
    float y1 = parseFloat(tokens[1]);
    float x2 = parseFloat(tokens[2]);
    float y2 = parseFloat(tokens[3]);

    MyAccessibility.instance.Swipte((int) x1, (int) y1, (int) x2, (int) y2, 50);

}
MyAccessibility class (Swipte() routine):

Code:
public void Swipte(int x1,int y1,int x2,int y2,int time){
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
            System.out.println(" ======= Swipte =======");

            GestureDescription.Builder gestureBuilder = new GestureDescription.Builder();
            Path path = new Path();
            path.moveTo(x1,y1);
            path.lineTo(x2,y2);

            gestureBuilder.addStroke(new GestureDescription.StrokeDescription(path, 0, time));
            dispatchGesture(gestureBuilder.build(), new GestureResultCallback() {
                @Override
                public void onCompleted(GestureDescription gestureDescription) {
                    System.out.println("SWIPTE Gesture Completed :D");
                    super.onCompleted(gestureDescription);
                }
            }, null);
        }

    }
Angehängte Grafiken
Dateityp: png hU3hF.png (154,0 KB, 41x aufgerufen)

Geändert von flashcoder (28. Aug 2018 um 03:49 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:43 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz