-1

I have this doubt, suddenly something more mathematical, for example I have the following geographical coordinates:

  • (4.80549328, -74.14376602)
  • (4.80755020, -74.14195687)
  • (4.80011076, -74.13276181)
  • (4.79816079, -74.13459823)
  • (4.80009735, -74.13592503)

They are forming a polygon vertices, we see that they are very small dots together, which place them directly in pixels does not have any effect. How do I scale a 500x500px box?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Gio
  • 21
  • 3

1 Answers1

1

If that is all under a Graphics class, you can simply use the ScaleTransform method, as documented here.

To get the scale factor, what you need to do is find the largest x and y coords. Use the largest one and then divide 500 by it, and use that factor both the x and y scaling factor, to maintain the aspect ratio.

Hope that helps you!

Community
  • 1
  • 1
FrostyFire
  • 3,212
  • 3
  • 29
  • 53
  • Let's say not much, but that's the idea. – Gio Feb 14 '13 at 01:14
  • Succeeded out as follows :)! Make the process for both x and y. For example for X; Rest the highest with the lowest, 500 divided by the result of the subtraction, this gives me the factor now for each x, rest the largest number x we want to locate, this result is multiplied by the factor and thats it. (500/(4.80755020-4.79816079)) = 42601.185804(Factor) Get a Point: (4.80755020-4.80549328) * 42601.185804(Factor) = 87.62718850 – Gio Feb 14 '13 at 01:39