---
title: "Calculate new position values"  
description: "Calculate new position values"  
author: "Anonymous User"  
published: 2014-08-28  
updated: 2014-08-28  
canonical: https://www.mindstick.com/forum/2179/calculate-new-position-values  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Calculate new position values

I have a [document](https://www.mindstick.com/articles/328642/what-to-consider-while-choosing-a-software-documentation-tool) which containing some elements. I [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to show it in a [webview](https://www.mindstick.com/articles/12868/webview-in-android) but in a smaller size than the original size. The [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is that I don´t get the correct positions in of the different spots in the webview. I got the correct size of the new spots but not the position. I made the calculations in the following way:

Original size (INDD document)

```
DocumentWidth = 768DocumentHeight = 1024New Size (Size of the webview)Width = 522Height = 696 percentW = newWidth(Webview)/DocumentWidthpercentH = newHeight(Webview)/DocumentHeight;
```

From these percent [values](https://www.mindstick.com/forum/327/sum-textbox-values) I am calculating all the new values I will need in the ImageMapper (top,left,bottom,right).

[Formula](https://answers.mindstick.com/qa/35906/is-formula-1-s-popularity-in-decline) for that

```
myPrecent = (percentW/percentH) * 100;        result =  myPrecent * ((top,left,right,bottom) / 100);
```

I suppose that I am [thinking](https://www.mindstick.com/blog/11889/how-to-change-your-thinking-paradigm) wrong in my [calculation](https://www.mindstick.com/forum/160723/factorial-calculation) but I cant figured out what I´m [doing wrong](https://answers.mindstick.com/qa/36736/what-are-indians-doing-wrong-on-whatsapp). So I will be appreciate [if someone](https://answers.mindstick.com/qa/99016/is-there-any-device-that-can-detect-if-someone-opens-your-backpack) has any idea what I have doing wrong.

## Replies

### Reply by Sumit Kesarwani

Hi Chintoo, \
try this:

verticalScaling = Height/DocumentHeight

horizontalScaling = Width/DocumentWidth

newTop = Top * verticalScaling

newLeft = Left * horizontalScaling

newBottom = Bottom * verticalScaling

newRight = Right * horizontalScaling


---

Original Source: https://www.mindstick.com/forum/2179/calculate-new-position-values

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
