I have a simple canvas which has a code to obtain the location where mouse is clicked. is there a way, I can convert the co-ordinates into millimeters, namely X and Y axis?
thanks
<Grid>
<Canvas x:Name="canvasMain" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="AliceBlue" MouseLeftButtonDown="canvasMain_MouseLeftButtonDown"/>
</Grid>
private void canvasMain_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var position = e.GetPosition(this.canvasMain);
if(Keyboard.IsKeyDown(Key.LeftShift))
{
MessageBox.Show("X->" + position.X + " - " + "Y->" + position.Y);
}
}