Solved

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

Posted on 2013-11-06
2
528 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now