Solved

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

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
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…

760 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

18 Experts available now in Live!

Get 1:1 Help Now