Screen Resolution Interpolation

Put your problem here if it does not fit any of the other categories.

Screen Resolution Interpolation

Postby dlaroche » Sat Feb 25, 2012 10:47 am

Hey,

I am sending touch events from a tablet to a PC as mouse coordinates. However, due to the different screen resolutions between the tablet, and PC I can only move the mouse cursor as far as the tablet resolution will allow me.

I need to scale or interpolate between the two resolutions from my understanding.

What would be a good approach or solution for this?

Thanks,
Dustin
dlaroche
Junior Developer
Junior Developer
 
Posts: 13
Joined: Fri Sep 16, 2011 6:34 pm

Top

Re: Screen Resolution Interpolation

Postby Phyll » Sat Feb 25, 2012 12:34 pm

Hi dlaroche,

I think a regular mouse on a PC works a little differently. From whereever its at, it just sends movement commands in a direction, the mouse itself doesn't keep track of where it is. It just sends move 12x and 6y. The software in the PC keeps track of where it is. That's why when you pick it up and put it down in a new spot, the mouse doesn't jump clear to the other side of the screen.

It sounds like maybe you are operating it like a digitizing pad where you now need to scale the movement on your tablet to the movement on the PC screen. I think that you should be able to just put scalers on your output to do that. Making it smaller or larger by some factor for the x,y coordinates. The problem with that is that you may not have a resolution that allows for moving by single pixels. Your finger is also a very blunt drawing tool for this method.

Hope this helps.

Phyll
Phyll
Master Developer
Master Developer
 
Posts: 648
Joined: Fri Oct 14, 2011 11:19 am

Re: Screen Resolution Interpolation

Postby dlaroche » Sat Feb 25, 2012 5:14 pm

Hi Phyll,

Yes, resolution/steps for the mouse is important here. Someone in the IRC channel threw out that I may want to look into bipolar interpolation so accomplish this, but I don't know if he was serious or just be a smart a$$.

As far as using your finger for a stylus it works quit well with the implementation that I have, however, I am limited to the motion possible on the computer screen due to the tablet resolution being smaller.

I have also tried:

xMove = (computerScreenWidth / tabletScreenWidth) * incomingTabletXCoord;

but I don't get the smoothness desired, and it tends to "step" around.

Any other suggestions?

Thanks,
Dustin
dlaroche
Junior Developer
Junior Developer
 
Posts: 13
Joined: Fri Sep 16, 2011 6:34 pm

Re: Screen Resolution Interpolation

Postby Phyll » Sat Feb 25, 2012 5:40 pm

Hi Dustin,

Well, I guess your app depends on discreet locations on the tablet grid representing a similar grid on the PC. In which case scaling would cause you the problems I mentioned. I don't think any fancier scaling will help. Perhaps you could invent something that takes moving one pixel on the tablet and over time moves it two or three on the PC so that you would have some control over where it stopped. An animation of the movement at a different scale so to speak. It would be much dependent on the touch time and feedback from the PC instead of the tablet. Probably all kind of difficulties in a project like that but the only thing I could think of at this time.

Hope this helps.

Phyll
Phyll
Master Developer
Master Developer
 
Posts: 648
Joined: Fri Oct 14, 2011 11:19 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 22 guests