X coordinate on destination surface = ( Xcoordinate on source surface * width of destination surface ) / width of source surface
You are correct but now we need to do that for every pixel in height.
Riht now the formula is
scrRatioX = (desktopW/mXd) // mXd is the width of the tablet at the given Y pixel, say top
scrRatioY = (desktopH/mYd) // mYd is the tablet height
cX = tabletX * scrRatioX
cY = tabletY * scrRatioY
SetCursorPos_(cX,cY)
Now on 2 perfect rectangles this is easy, but when the top is shorter or longer, we would need to have this formula run through every Y pixel of the odd shape tablet and calculate X dependent on the Y. Now this is a huge calculation to be done on the fly.
There has to be a geometric calculation that given 4 corners (tablet) or something like that it can give you the correct position when giving it the other 4 corners (screen).
I have it semi-working with my formula, but I don't think is good enough.
I know it may have to do with triangulation, but again, I failed geometry. Now I know the answer to when I asked my self in highschool, "why do I need to take geometry".
