开发者

Floor Maps using C#

开发者 https://www.devze.com 2023-03-29 19:20 出处:网络
I intend to make an application that is related to parking management.User fills in the places where car is present.

I intend to make an application that is related to parking management.User fills in the places where car is present.

The figure shown below is taken from a software made in chines language. It has parking bays and user selects that if it is free or not. I donot understand how it is done but that software takes bmp file as input and then user can add bay information to it.

after the information has been added user can click on any bay added to see its information.

i am confused that how a bmp file can be layered in such a way that each bay is being identified seperately.

anyt开发者_运维问答hing(winform or WPF) in which this task is easy to accomplish i want to know that how can i acomplish this task. any open source library ?anything.

Floor Maps using C#


I would start with the fact that all the bays are white, so by doing a little image processing a program can determine what the layout of the garage is by finding all the colors, then getting the information that will lead to a legend being generated. This is useful since then when adding information to stairs, for example, it will be different than information on a parking spot.

Now, since the bmp map is static, I would convert it to a .png for ease of use.

Then, create a second .png that has a transparent background and put that on top of the first, so information such as the numbers can be added.

So then you could have multiple layers by going with this approach, and display it by putting the correct layers on as needed.

You could also just store the x,y coordinates of the labels, but I think that would be bad since then the program has to add this to the image every time, rather than just doing it one time.


I know this isn't a C# answer, but winforms and wpf can both host a web browser control. That is a nice feature since html has support for something called image maps which do exactly what you are looking for. Essentially, you can identify areas in a single image and when clicked, hovered, etc... do something with them.

Image maps: http://www.w3schools.com/TAGS/tag_map.asp

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号