8214 views|10 replies

76

Posts

0

Resources
The OP

Screen coordinates of LCD touch screen and touch screen coordinates??? [Copy link]

The origin of screen coordinates is usually in the upper left, so where is the origin of touch screen coordinates? Some people on the Internet say it is in the upper right, some say it is in the lower right, and some say it is in the lower left. I am confused! ! There is also the touch screen information in the platform.reg registry [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\TOUCH] "MaxCalError"=dword:7 ; portrait ;for 240x320 display "CalibrationData"="469,636 785,1068 162,1056 163,220 785,216 " ; Landscape ; "CalibrationData"="515,503 763,748 258,749 269,255 764,255 " ENDIF BSP_NOTOUCH ! These are the coordinate values of the five points on the screen (the four corners and the center) on the touch screen. Does this have anything to do with the position of the origin of the touch screen! ! ! PS: After mini2440 changed to the latest BSP, the touch screen has a problem, it seems to be reversed. I want to solve it by rewriting the touch screen driver! !

This post is from Embedded System

Latest reply

OK, got it, thank you everyone!!  Details Published on 2009-11-11 14:32

64

Posts

0

Resources
2
The origin of LCD and touch screen is in the upper left or lower right according to the specific circuit. If it is the opposite, it can be realized by coordinate transformation. The following ideas are for reference only. You can be more flexible when implementing it yourself. Assume that the LCD resolution is 320*240 and the coordinate origin is in the upper left corner; the touch screen resolution is 900*900 and the coordinate origin is in the upper left corner. The conversion formula is as follows: xLCD=[320*(x-x2)/(x1-x2)]; yLCD=[240*(y-y2)/(y1-y2)]; If the coordinate origins are inconsistent, for example, the LCD coordinate origin is in the lower right corner, and the touch screen origin is in the upper left corner, you can also perform the following conversion: xLCD=320-[320*(x-x2)/(x1-x2)]; yLCD=240-[240*(y-y2)/(y1-y2)]; For reference only
This post is from Embedded System

70

Posts

0

Resources
3
So there are only four situations! Prepare and try them one by one! !
This post is from Embedded System

59

Posts

0

Resources
4
I've never thought about this before. You can try it according to your own ideas and you should know it. After you try it, post it for everyone to see.
This post is from Embedded System

77

Posts

0

Resources
5
Quote the reply from tcdzyq on the first floor: The origin of LCD and touch screen is in the upper left or lower right according to the specific circuit. If it is the opposite, it can be achieved through coordinate transformation. The following ideas are for reference. You can be more flexible when implementing it yourself. Assume that the LCD resolution is 320*240, and the coordinate origin is in the upper left corner; the touch screen resolution is 900*900, and the coordinate origin is in the upper left corner. The conversion formula is as follows: xLCD=[320*(x-x2)/(x1-x2)]; yLCD=[240*(y-y2)/(y1-y2)]; If the coordinate origins are inconsistent, for example, the LCD coordinate origin is in the lower right corner, and the touch screen origin is in the upper left corner, you can also perform the following conversion: xLCD=320-[320*(x-x2)/(x1-x2)]; yLCD=240-[240*(y-y2)/(y1-y2)]; For reference only
There are also left-right or up-down swaps.
This post is from Embedded System

58

Posts

0

Resources
6
Landscape; "CalibrationData" = "515,503 763,748 258,749 269,255 764,255 I calculated your data for you. The coordinate origin is in the lower right corner (horizontal direction is Y, vertical direction is X). You can calculate it according to the touch screen calibration sequence.


This post is from Embedded System

76

Posts

0

Resources
7
What is the difference between a resolution of 320*240 and a resolution of 240*320? ? Why do I feel the same!! Isn't it just that the x-axis and y-axis are reversed?
This post is from Embedded System

95

Posts

0

Resources
8
Quote from stoneqiang on the 5th floor: Landscape? ;? ? ? "CalibrationData "= "515,503? 763,748? 258,749? 269,255? 764,255? I calculated your data for you. The coordinate origin is in the lower right corner (horizontal direction is Y, vertical direction is X). You can calculate it according to the touch screen calibration sequence. Thank you!!! Do you want to use this format? xLCD=320-[320*(x-x2)/(x1-x2)]; yLCD=240-[240*(y-y2)/(y1-y2)]; I think this is the meaning.
This post is from Embedded System

65

Posts

0

Resources
9
I haven't noticed it before, please pay attention if you pass by!
This post is from Embedded System

86

Posts

0

Resources
10
Quote lyx_wq's reply on the 7th floor: Quote stoneqiang's reply on the 5th floor: Landscape? ;? ? ? "CalibrationData" = "515,503? 763,748? 258,749? 269,255? 764,255? I calculated your data for you. The coordinate origin is in the lower right corner (horizontal direction is Y, vertical direction is X). You can calculate it according to the touch screen calibration sequence. Thank you!!! Do you want to use this format? xLCD = 320-[320*(x-x2)/(x1-x2)]; yLCD = 240-[240*(y-y2)/(y1-y2)]; I think this is the meaning.
You can actually deduce the formula yourself. I didn't use this company to calculate it. I determined the origin based on the values and calibration order of the touch screen calibration (center, upper left, lower left, lower right, upper right). You can use this method to verify whether the formula is correct. ^_^
This post is from Embedded System

75

Posts

0

Resources
11
OK, got it, thank you everyone!!
This post is from Embedded System

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

    EEWorld
    subscription
    account

    EEWorld
    service
    account

    Automotive
    development
    circle

    Robot
    development
    community

    Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
    快速回复 返回顶部 Return list