Question Dealing with Multiple Resolutions

Matt8883

New member
Joined
Sep 19, 2010
Messages
1
Programming Experience
3-5
Hey there, this is my first post so hello I suppose. :p

I'm fairly knowledgable when it comes to programing and would consider myself an intermediate in Visual Basic .net but I'm relatively new to working with graphics.

Essentially I have a program that contains a map within a picturebox, the user is able to select an object placed on the map and click on a target location on the map, which will set a path to move that object over a period of time towards the target destination. Overall this really isn't a complex issue at all, however the problem comes when this program has to be deployed to computers that can range in display resolution. How am I to build the code so that the co-ordinates are universal regardless of the actual dimensions of the picture box which will have to change based on the display resolution being used.

This is important because the location of the co-ordinates of objects and their target location are stored in a database and the actual movement of the objects is done through a server application.

I remember back in VB6 we could create a grid plane across the picturebox so that it wouldn't matter much what the actual dimensions were as long as the height and width were the same.

Any help would be appreciated, thanks!
 
Resolution independence has plagued programmers for a very long time now. I also am writing a program that needs to be resolution independent. What I do is have a ratio offset to add or subtract to the size of the control. So for your picturebox, you could have it be 1\4 the size of the screen. Then any of the coordinates should be also offset by that size.

So say,

pic1.width = Screen.PrimaryScreen.Bounds.Width * .25
pic1.height = Screen.PrimaryScreen.Bounds.Height * .25

and then offset your coordinates the same way.

Not sure if that will help you, but it is a start to a way of thinking.

Good luck!

Josh
 

Latest posts

Back
Top