Solved

Picture Box to be same size on the screen across multiple resolutions

Posted on 2013-11-06
2
540 Views
Last Modified: 2013-11-06
I have a picture box on a 1024 x 768 screen that measures 8.5 x 11 inches.  I would like for it to have the same dimensions on a higher resolution screen. Any suggestions experts?  Tks in advance.
0
Comment
Question by:GCCal
2 Comments
 
LVL 35

Accepted Solution

by:
Kimputer earned 500 total points
ID: 39628904
Please note you cannot fix the "real" size of a picture box on any screen. After all, you don't know if the screen is 21", 23" or even 27", as all these screens probably have 1920 x 1080 resolution. You can imagine, if your code works on a 21" screen, with code for 1920 x 1080 resolution, on the 27" screen it's actually bigger. And VB.net (or any other programming code) actually cannot tell how much inch a screen is.
0
 

Author Comment

by:GCCal
ID: 39629050
Kimputer.............many thanks for your response.  Makes sense.

I worked around it a bit by using this code when the application starts:

        Dim GetWidth = Screen.PrimaryScreen.WorkingArea.Width
        Dim GetHeight = Screen.PrimaryScreen.WorkingArea.Height
        picCanvas.Width = picCanvas.Width * (GetWidth / 1024)
        picCanvas.Height = picCanvas.Height * (GetHeight / 768)

It is not perfect, but it gets the dimensions close enough for me

Thanks again.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question