V
V
Vyacheslav Kuznetsov2018-02-28 08:36:59
C++ / C#
Vyacheslav Kuznetsov, 2018-02-28 08:36:59

Is it possible to scale the contents of a picturebox?

Good afternoon!
For the diploma, I am writing a program that receives the coordinates of a certain area as input. Those. we have a certain plane bounded by points (which we get at the input), an example in the figure:
5a963e5fa2b1b574661763.png
Each coordinate is taken from the map of the area, i.e. in the format "latitude and longitude", as I understand it. An example of points (from a test file):

Coordinates example
50.9018801740908; 44.171718735159
50.9024254228679; 44.1720544617649
50.9030763703124; 44.1724405216281
50.9100161851308; 44.1873088537979
50.9098238074; 44.1874166202763
50.904334473343; 44.1731779077891
50.9156223825292; 44.1820619765303
50.9044825719287; 44.1732652481595
50.9155418149944; 44.1821900361738
50.9046312389235; 44.1733336974884
50.9048511581016; 44.1734475337
50.9152923795792; 44.1825732370222
50.9055704026236; 44.1738590801497
50.9057826992912; 44.1739874951811
50.9062854717713; 44.1742762666216

The problem is that due to the scale of the map, it is not possible to display the field well. By "good" I mean displaying the field in such a way that it takes up most of the picturebox area. Therefore, I see two solutions:
1) You need to transform the coordinates themselves (i.e., knowing the scale, change them), and then somehow change the origin of the picturebox. The problem here is that I don't know how to change the origin.
2) Zoom in on the picturebox itself. And here I also don’t know how to solve.
I’ll be grateful for the help, Google didn’t give me an answer, I don’t exclude that I didn’t search well.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
evgeniy_lm, 2018-02-28
@evgeniy_lm

picturebox is a SMALL window into which you view a BIG map (like "Earth in the window"). Those. you have a high-resolution map, you load this map into some kind of bitmap, and from there you copy the desired piece as you move along the map. Of course, this piece needs to be scaled, only the scale is not increased, but reduced. If the map is very large, you can divide it into several parts and load the necessary parts as you go.
PS If you really need it, I can implement it for a small fee in Delphi or Lazarus

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question