Finding coordinates of a character?

Uwais A

I have a multi-line TextView. Is there a way to get the x coordinate of the pixel to the left of a character e.g. the 3rd character? In my case it will always be the 3rd character, but a general solution would be nicer.

I have the y coordinate of the pixel just above the character using:

Layout textViewLay = mTextView.getLayout();
int posY = textViewLay.getLineTop(0);

but the x coordinate has me stumped. Any ideas? I'm probably missing something really simple.

Cuong Huynh

Try to use this code:

Rect bounds = new Rect();
Paint tpaint = textView.getPaint();
tpaint.getTextBounds(text,0,2,bounds);
int height = bounds.height();
int width = bounds.width();

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Finding coordinates of a character?

From Dev

Finding a square in a group of coordinates

From Dev

Finding Location / Coordinates in Dart

From Dev

Finding coordinates of a point on a line

From Dev

svg: Coordinates of a character?

From Dev

SQL Finding the coordinates that belong to a circle

From Dev

Finding coordinates of rectangle on a curved surface

From Dev

Finding coordinates of the circumference of circle in pygame

From Dev

Finding a joint / bone in a character

From Dev

Finding "opposite" or closing character

From Dev

Finding "opposite" or closing character

From Dev

Finding the character "^" using regex

From Dev

Finding "-" Character in a String in JAVA

From Dev

finding the copyright character with Beautifulsoup

From Dev

Replace character based on range of coordinates

From Dev

Math behind finding screen coordinates in a path tracer

From Dev

Finding center of set of coordinates using Java

From Dev

Finding the distance of coordinates from the beginning of a route in Shapely

From Dev

Finding World Space Coordinates of a Unity UI Element

From Dev

Finding the coordinates of a sub-image in an image in Matlab

From Dev

Finding formulation of curve using coordinates in MATLAB

From Dev

Finding x,y coordinates of a point on an Archimedean spiral

From Dev

Finding coordinates points in circle sector matlab

From Dev

Parsing Float to Int when finding coordinates

From Dev

Utilities for finding x/y screen coordinates

From Dev

Finding the angle made by a line in mathematical coordinates?

From Dev

Finding formulation of curve using coordinates in MATLAB

From Dev

Math behind finding screen coordinates in a path tracer

From Dev

Finding the lat/long coordinates in a Google Maps URL

Related Related

  1. 1

    Finding coordinates of a character?

  2. 2

    Finding a square in a group of coordinates

  3. 3

    Finding Location / Coordinates in Dart

  4. 4

    Finding coordinates of a point on a line

  5. 5

    svg: Coordinates of a character?

  6. 6

    SQL Finding the coordinates that belong to a circle

  7. 7

    Finding coordinates of rectangle on a curved surface

  8. 8

    Finding coordinates of the circumference of circle in pygame

  9. 9

    Finding a joint / bone in a character

  10. 10

    Finding "opposite" or closing character

  11. 11

    Finding "opposite" or closing character

  12. 12

    Finding the character "^" using regex

  13. 13

    Finding "-" Character in a String in JAVA

  14. 14

    finding the copyright character with Beautifulsoup

  15. 15

    Replace character based on range of coordinates

  16. 16

    Math behind finding screen coordinates in a path tracer

  17. 17

    Finding center of set of coordinates using Java

  18. 18

    Finding the distance of coordinates from the beginning of a route in Shapely

  19. 19

    Finding World Space Coordinates of a Unity UI Element

  20. 20

    Finding the coordinates of a sub-image in an image in Matlab

  21. 21

    Finding formulation of curve using coordinates in MATLAB

  22. 22

    Finding x,y coordinates of a point on an Archimedean spiral

  23. 23

    Finding coordinates points in circle sector matlab

  24. 24

    Parsing Float to Int when finding coordinates

  25. 25

    Utilities for finding x/y screen coordinates

  26. 26

    Finding the angle made by a line in mathematical coordinates?

  27. 27

    Finding formulation of curve using coordinates in MATLAB

  28. 28

    Math behind finding screen coordinates in a path tracer

  29. 29

    Finding the lat/long coordinates in a Google Maps URL

HotTag

Archive