TouchInput Scaled after implementing scaling factor

Hi,
I’ve used a scaling matrix for my android game, So that the game may scale correctly on any device. But the touch input doesn’t work correctly.

The touch is being registered many pixels away. I have tried this without scaling and it works fine.

I need the touch to work correctly after scaling.

This is the code that I used to check the touch input.

http://pastebin.com/8Fe6D3rd

Please Help !

If you set the TouchPanel.DisplayHeight and TouchPanel.DisplayWidth to the BackBufferWidth and BackBufferHeight during startup then it will scale the touch inputs correctly.

Hi, thanks for the reply.
I set the TouchPanel.DisplayWidth and TouchPanel.DisplayHeight to the BackBufferWidth and BackBufferHeight in the Initialize method. but it din’t work.

I then tried this :

foreach (TouchLocation touch in touchs)
{
var scaledLocation = new Vector2(touch.Position.X / scalingFactor.X, touch.Position.Y / scalingFactor.Y);
}

And It worked.

But will this affect performance in any way?