I want to create a map, with image of a floor plan. As the user zooms in or out, or moves the image around the form and clicks on a room to see more information about it, it will be possible. I'm thinking of creating labels or buttons with opasity set to 0%, over the rooms. However, when I zoomed in, the label stayed in the same location, it didn't move with the image as it was zoomed in/out, moved. How could this be solved in a painless way. Thanks for you efforts.
Start4me
0
Newbie Poster
Recommended Answers
Jump to PostYou will have to size the lables accordingly.
One idea would be to get the size ratio of the label and using that ratio scale the label when the image is scaled.
You will also have to move the label when the image is moved. One way you might be …
Jump to PostYour code simply adds 10 (or subtracts) to the label no matter if the user scales the image 10 pixels.
You will have to get the amount the image changed and reflect that change on the label.
As for the label saying the wrong location, do you have code that …
Jump to PostDo you have the image inside a panel? Or maybe in PictureBox?
Something that has a Resize event can be used to compute change amount.
You could also look at using mousedown and mouseup as well. These would only change the label size when the user released the mouse button.
…
Jump to PostOne thing you may actually want to look at is drawing on the image itself. Is there a specific reason you want a lable? Will you be chaning text on runtime?
If not, you can draw over the image with something like this:
Using g As Graphics …
All 13 Replies
Begginnerdev
256
Junior Poster
Start4me
0
Newbie Poster
Start4me
0
Newbie Poster
Start4me
0
Newbie Poster
Begginnerdev
256
Junior Poster
Start4me
0
Newbie Poster
Begginnerdev
256
Junior Poster
Start4me
0
Newbie Poster
Start4me
0
Newbie Poster
Start4me
0
Newbie Poster
Begginnerdev
256
Junior Poster
Start4me
0
Newbie Poster
Begginnerdev
256
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.