title: Draw remote text on Picturebox
body: <p>I had used <a href="https://developer.android.com/reference/android/accessibilityservice/AccessibilityService" rel="nofollow noreferrer">AccessibilityService</a> to get location X and Y of elemet that is displayed on screen of my smartphone. Now i need draw this element (that is a text) on <code>PictureBox</code>, according with position that is showing on remote device (my smartphone).</p>
  <p>This was tried, but without success:</p>
  <pre><code>    public frmMain()
      {
          InitializeComponent();
          pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height);
      }
      
      // ...
      
      string[] tokens = item.SubItems[5].Text.Split('x'); // remote screen resolution (W x H), Eg: 1080x1920
      
      var text = &quot;text&quot;; // element to draw on PictureBox 
      var x = 200; // position X of element on remote screen
      var y = 170; // position Y of element on remote screen
      
      using (Graphics g = Graphics.FromImage(pictureBox1.Image))
      {
          g.DrawString(text, new Font(&quot;Tahoma&quot;, 8), Brushes.Black, new Point((int.Parse(x) * int.Parse(tokens[0].ToString())) / pictureBox1.Width, (int.Parse(y) * int.Parse(tokens[1].ToString())) / pictureBox1.Height));
      }
  
      pictureBox1.Invalidate();
  </code></pre>