The dialog size is different in computers - visual-c++

I have one desktop and one laptop (windows 10).
The size of the monitor installed on the desktop is 24 inches.
They are same resolution(1920 by 1080) and i set same zoom ratio in Windows 10.
I do not use Movewindow function or other things to fix the size, however, the dialog size in the laptop and the desktop is different.
It causes that the controls in my software are overlapping each other.
please let me know if i notify other settings!!
Thank you.
Sorry, my question is not specific, i add two pictures.
In laptop, the setting of Windows is overlapped with the setting of DICOM.
Of course, i can make the controls not overlapping when i directly use 'movewindow' on dialog, but i want to know why the two dialogs have different size.(same resolution(1920 x 1080), same zoom ratio on windows 10)
In Desktop, the print dialog has 791 x 632 size, in latop, the print dialog has 911 x 816 size.
I will check DPI-Awareness. Thank you for your comments!
I'm getting to know about this phenomenon.
In laptop, The resolution is 1920 X 1080, However, the ratio value which Windows 10 recommend is 125%.
I Change the ratio to 100% then, It worked at a higher resolution i think.
I use this code to get a resoltion.
MONITORINFO mi;
::ZeroMemory(&mi, sizeof MONITORINFO );
mi.cbSize = sizeof MONITORINFO;
if( ::GetMonitorInfo(hMonitor, &mi))
In laptop,
When i use 100% the size of text, apps, and other items in Scale and layout,
then The mi.rcMonitor's width = 2400
if i change the ratio value to 125%(which windows recommend), then The mi.rcMonitor's width = 1920
I don't know how to represent 2400 * 1350 in 1920 * 1080 monitor, so i will study this!

Related

RK3399 yields invalid MIPI-DSI signal with correct timings and valid signal with incorrect timings

We build our own Yocto environment and distribution using a 5.10.119 kernel and mesa 20.3.
Currently we are trying to get an MIPI-DSI (ILI9881C) screen up and running on an SOM-RK3399v2 (Friendly-Elec) but have some troubles: We can get the screen to display an image, however, its shifted roughly 100px. This shift depends highly on the used MIPI-Clock (mbps).
All timings and clocks are correct and triple checked with the screen-vendor. We tried many configurations, did several Hardware revisions to our Mainboard and even tested the SOM-RK3399-Eval board from Friendly-Elec. All show the same behavior.
In an accident, we found an actual working configuration for the screen. However, on a mathematical basis, these settings should never work, but they do!
The screen vendor supplied us with the following timings:
H 800
HSW 20
HBP 20
HFP 20
V 1280
VSW 10
VBP 20
VFP 10
PCLK 68112 (60fps)
The driver implementation for the RK3399 MIPI-DSI selects mbps=510 for these timings.
But using these values results in the shifted image:
Notice how y100 is directly at the top of the screen, rather than 100px from the bottom.
Several try and errors later we found a configuration that works for the screen but shouldn't:
H 800
HSW 33
HBP 500
HFP 500
V 1280
VSW 10
VBP 20
VFP 10
PCLK 145173 (60fps)
MBPS 457
As you can see, those timings are ridiculously off the charts and PCKL does not fit to the (hardcoded) MBPS of 457. However, the screen shows a correct and nicely aligned image without flickering whatsoever.
We further diagnosed this and found that the RK3399 sends some strange or even malformed MIPI-DSI-Data-Stream when going from LP(LS) to HS to the screen using the correct timings, but sends a perfectly fine LS2HS-Data-Stream to the screen with incorrect timings:
Observe how the signal for the correct timings is hold high way to long (times 3) and the switch from low-power to high-speed seems to be corrupted.
Therefore, we assume that the shift in our image might be related to that incorrect LP2HS.
Have you seen such behavior before? Do you know what could yield this behavior? It seems like it does 3 blankings instead of 1?

Why is my Windows application/game capped at 30FPS when running on an Intel GPU?

I'm working on a fullscreen Windows desktop application that's moderately graphics-intensive, it uses OpenGL but only renders 2D content. Nothing fancy, mostly pushing pixels to the screen (up to 4K, single monitor) and uploading textures. We're using VSync to control the rendering framerate, ie. calling SwapBuffers() at the end of rendering to block until the next VBlank.
The main requirement we have is that the app runs at a solid 60FPS as it's used with a touchscreen, and interactions need to be as fluid as possible.
Because it's pretty basic, the app runs just fine on a 8th gen Intel i7 CPU with integrated Intel HD Graphics 630 GPU. Neither the CPU or GPU are anywhere near peak usage, and we can see that we're hitting a comfortable 60FPS through our in-app FPS meter. I also have it running with similar results on my Surface Book 2 with Intel i7 and integrated Intel UHD Graphics 620 GPU.
However, what I've recently started noticing is that the app sometimes starts dropping to 30FPS, then staying there either for long periods of time or sometimes even permanently. Through our FPS meter, I can tell that we're not actually spending any time rendering, it's just our SwapBuffers() call that blocks arbitrarily for 2 frames, capping us at 30FPS. The only way to get back to 60FPS is to alt-tab with another app and back to ours, or simply bringing the Windows menu up then going back to the app.
Because of the app going back to 60FPS afterwards, I'm positive that this is an intended behavior of the Intel driver, probably meant for gaming (gamers prefer a stable 30FPS rather than irregular/occasional dropped frames which make the game look choppy).
However in our case, dropping an occasional frame isn't a big deal, however being capped at 30FPS makes our UI and interactions far less pleasing to the eye, especially when it could easily render at a smooth 60FPS instead.
Is there any way to switch the driver behavior to prefer pushing 60FPS with occasional drops rather than capping at 30FPS?
OK so I was able to figure this out with a little bit of tweaking and reverse-engineering: The answer is that yes this is an intended but unfortunate default behavior of the Intel driver, and it can be fixed via the Intel HD Graphics Control Panel app if available, or directly in the registry otherwise (which is the only way to fix the issue on the Surface Book and other Surface devices, where the custom Intel driver doesn't expose the Intel HD Graphics Control Panel app anymore).
Starting with the simple solution: In the Intel HD Graphics Control Panel app, go to "3D", then "Application Settings". You'll first need to create an application profile, by selecting the file on disk for the process that creates the OpenGL window. Once that's done, the setting you want to adjust is "Vertical Sync". By default, "Use Application Default Settings" is selected. This is the setting that causes the capping at 30FPS. Select "Use Driver Settings" instead to disable that behavior and always target 60FPS:
This should've been pretty obvious, if it wasn't for Intel's horrible choice of terms and incomprehensible documentation. To me it looks like the choices for the settings are inverted: I would expect the capping to happen when I select "Use Driver Settings", which then implies the driver is free to adjust buffer swapping as it sees fit. Similarly, "Use Application Default Settings" implies that the app decides when to push frames, which is precisely the opposite of what the setting does. Even the little help bubbles in the app seem to contradict what these settings do...
ps: I'll post the registry-based solution in a separate answer to keep it short
Here is the registry-based answer, if your driver does not expose the Intel HD control panel (such as the driver used on the Surface Book and possibly other Surface laptops), or if you want to make that fix programmatically via regedit.exe or the Win32 API:
The application profiles created by the Intel HD control panel are saved in the registry under HKCU\Software\Intel\Display\igfxcui\3D using a key with the process file name (e.g. my_game.exe) and a REG_BINARY value with a 536-byte data blob divided like this:
Byte 0-3: Anisotropic Filtering (0 = use app default, 2-10 = multiplier setting)
Byte 4-7: Vertical Sync (0 = use app default, 1 = use driver setting)
Byte 8-11: MSAA (0 = use app default, 1 = force off)
Byte 12-15: CMAA (0 = use app default, 1 = override, 2 = enhance)
Byte 16-535: Application Display Name (wide-chars, for use in the control panel's application list)
Note: all values are stored in little-endian
In addition, you need to make sure that the Global value under the same key has its first byte set to 1, which is a sort of global toggle.(the control panel sets it to 1 when one or more entries are added to the applications list, then back to zero when the last entry is deleted from the list).
The format of value is also a REG_BINARY value with 8 bytes encoded like this:
Byte 0-3: Global toggle for application entries (0 = no entries, 1 = entries)
Byte 4-7: Application Optimal mode (0 = enabled, 1 = disabled)
For example:

How to detect/find Windows 8 current scale percentage

There are three scale percentages in Windows 8:
•100% when no scaling is applied
•140% for HD tablets
•180% for quad-XGA tablets
How can I detect in WinRT code what percentage the screen is at that moment?
(I want to make a custom image service that loads the best resolution from a database)
Use
var currentScale = DisplayProperties.ResolutionScale;

Programatically painting pixels on the screen at the max (or next to) refresh rate (eg 60 hz) on linux?

I'm looking into rendering frames at a high rate (ideally next to the max monitor rate) and I was wondering if anyone had any idea at what level I should start looking into: kernel/driver level (OS space) ? X11 level ? svgalib (userspace) ?
On a modern computer, you can do it using the ordinary tools and APIs for graphics. If you have full frames full of random pixels, a simple bit blit from an in-memory buffer will perform more than adequately. Without any optimization work, I found that I could generate more than 500 frames per second on Windows XP using 2008 PCs.

VB net control form size over different resolutions

I am working with a VB window that seems to want to resize depending on the resolution of the monitor.
Right now, I have VS2010 open on a monitor that is 1366 x 768. I have the form set to the following dimensions:
MaximumSize, MinimumSize and Size are all set to 948x580.
When I run the app, it looks fine.
Now, I have another monitor that has the resolution set to 1680x1050.
When I run the app, the window is 1263x705.
I was under the impression, that forcing the Max and Min sizes would lock the size of the window. Is this correct? Is there some other setting I am possibly missing?
take care,
lee
This is just a guess but what is your Form.AutoScaleMode set to? It is defaulting to the AutoScaleMode.Font Enumeration on my system even though the documentation says it defaults to AutoScaleMode.None. You may want to look at this MSDN link on AutoScaling also.
None - Automatic scaling is disabled.
Font - Controls scale relative to the dimensions of the font the classes are using, which is typically the system font.
Dpi - Controls scale relative to the display resolution. Common resolutions are 96 and 120 DPI.
Inherit - Controls scale according to the classes' parent's scaling mode. If there is no parent, automatic scaling is disabled.

Resources