Announcement

Collapse
No announcement yet.

Poor text crispness...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Poor text crispness...

    I never noticed this before - Look at the difference between the text in the top and the text in the label.
    Strange! Both are Segoe UI.

    Click image for larger version

Name:	Snap75.jpg
Views:	98
Size:	60.0 KB
ID:	785581
    Attached Files

  • #2
    Hi David,

    Can you show some code on how you got the display? I would not expect the fuzzy unless from zoomed graphics were involved..

    Comment


    • #3
      > I would not expect the fuzzy unless from zoomed graphics were involved..

      You will get a bad surprise the day you will need to use High DPI.

      Ask David which DPI he is using.
      Forum: http://www.jose.it-berater.org/smfforum/index.php

      Comment


      • #4
        Jose, which dpi setting are your refereeing to? Are you saying it is my computer/screen OR are you saying there is a dpi setting in PB?

        Gary, here is the code. Straight out of PB Forms. It only looks zoomed because I placed it on the forum as large rather than actual size.

        Code:
        #PBFORMS CREATED V2.01
        #COMPILE EXE
        #DIM ALL
        
        #PBFORMS BEGIN INCLUDES 
        #RESOURCE "NoName.pbr"
        #INCLUDE ONCE "WIN32API.INC"
        #INCLUDE ONCE "COMMCTRL.INC"
        #INCLUDE ONCE "PBForms.INC"
        #PBFORMS END INCLUDES
        
        #PBFORMS BEGIN CONSTANTS 
        %IDD_DIALOG1 =  101
        %IDC_LABEL1  = 1001
        %IDC_BUTTON1 = 1002 '*
        #PBFORMS END CONSTANTS
        
        DECLARE CALLBACK FUNCTION ShowDIALOG1Proc()
        DECLARE FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
        #PBFORMS DECLARATIONS
        
        FUNCTION PBMAIN()
            PBFormsInitComCtls (%ICC_WIN95_CLASSES OR %ICC_DATE_CLASSES OR %ICC_INTERNET_CLASSES)
        
            ShowDIALOG1 %HWND_DESKTOP
        END FUNCTION
        
        CALLBACK FUNCTION ShowDIALOG1Proc()
        
            SELECT CASE AS LONG CB.MSG
                CASE %WM_INITDIALOG
        
                CASE %WM_NCACTIVATE
                    STATIC hWndSaveFocus AS DWORD
                    IF ISFALSE CB.WPARAM THEN
                        hWndSaveFocus = GetFocus()
                    ELSEIF hWndSaveFocus THEN
                        SetFocus(hWndSaveFocus)
                        hWndSaveFocus = 0
                    END IF
        
                CASE %WM_COMMAND
                    SELECT CASE AS LONG CB.CTL
        
                    END SELECT
            END SELECT
        END FUNCTION
        
        FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
            LOCAL lRslt  AS LONG
        
        #PBFORMS BEGIN DIALOG %IDD_DIALOG1->->
            LOCAL hDlg   AS DWORD
            LOCAL hFont1 AS DWORD
        
            DIALOG NEW hParent, "ABCDEFG12345", 825, 456, 173, 115, TO hDlg
            CONTROL ADD LABEL, hDlg, %IDC_LABEL1, "ABCDEFG12345", 3, 4, 104, 20
            CONTROL SET COLOR  hDlg, %IDC_LABEL1, %WHITE, RGB(0, 99, 177)
        
            FONT NEW "Segoe UI", 10, 0, %ANSI_CHARSET TO hFont1
        
            CONTROL SET FONT hDlg, %IDC_LABEL1, hFont1
        #PBFORMS END DIALOG
        
            DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc TO lRslt
        
        #PBFORMS BEGIN CLEANUP %IDD_DIALOG1
            FONT END hFont1
        #PBFORMS END CLEANUP
        
            FUNCTION = lRslt
        END FUNCTION

        Comment


        • #5
          David,
          When I run the code here I do not see any fuzzy.

          One thing to remember is that anti-aliasing is being applied. Depending on the background color, the anti-aliased pixels in each version are not identical. Is that what you are seeing?

          Added ... the image you posted is NOT what the code generates. It produces different backgrounds but what you posted has the same background.

          Comment


          • #6
            DPI used in Windows, with your monitor/Screen.

            if you are using windows with DPI other that 100% (Scaling and layout) you will notice that fuzziness. (Usually complete dialog)

            since windows 10 creator edition they do a sort of hybrid scaling, where you get results like you displayed on your OP.
            it scales what it recognizes properly and what it doesn't it scales as a bitmap giving fuzziness.

            DDT is not High DPI aware.

            you can use Jose CWindows classes if you what to make High DPI aware programs.

            Comment


            • #7
              Jose,

              You will get a bad surprise the day you will need to use High DPI.
              Yes, I have the aspirin here in a bottle to address the coming headache!

              Comment


              • #8
                Interesting... Must be the fact that I have my screen scaled down to 75% of full.

                Comment


                • #9
                  I have making some display adjustments on user's machines to try to improve reading of text.
                  I had themes services turned off on all the machines but I was having a hard time reading a ultraside monitor that was a LG 29 inch monitor with 2560x1080.
                  Tge first ultreawide in use. The next uktrawide bought were 34 inch monitors. Don't get the 29. The 34 are much better and they read good with a theme.

                  But many screens of 1920x1080 read terrible with themes.
                  I played with setting some of the window properties that can be set.
                  I found out how terrible some screens look.
                  Apple computer controls mostly the screens used on their machines and scaling is great on those where you are using their screens but other screens by other manufactures can look terrible
                  p purvis

                  Comment


                  • #10
                    A few weeks ago I wrote a tool for Paul Squires' FreeBASIC IDE using PB's DDT. Paul has a 4K monitor and my forms ended up half the width and half the height. I rewrote the tool using FreeBASIC and José's FreeBASIC WinFBX which has his CWindow class. Now my forms appear the same size on Paul's 4K monitor and my 1920x1080. What an eye opener that was.

                    When I wrote Encrypternet, in FreeBASIC, I used José's CWindow class and used one of his templates to get started. What I did not realize was that I was writing a high dpi application. In the code was AfxSetProcessDPIAware and not being high dpi 'savvy' at the time I left it in. It transpires that there was no need because I had <dpiAware>true</dpiAware> in the manifest. Of course, it was the use of the CWindow class that 'did the trick'. Had I used DDT then there may have been a few disgruntled users with 4K monitors; and they are becoming very affordable.

                    Comment


                    • #11
                      Originally posted by David Clarke View Post
                      Interesting... Must be the fact that I have my screen scaled down to 75% of full.
                      Any DPI value higher than 96, which is neutral default, will start causing problems.
                      Forum: http://www.jose.it-berater.org/smfforum/index.php

                      Comment


                      • #12
                        > Paul has a 4K monitor [...]

                        Even Paul did not fully understand about what I have been talking during several years until he bought that monitor. Suddenly he noticed that its old FireFly visual designer for PB was unusable with its new hardware. Fortunately he has written WinFBE using my framework.
                        Forum: http://www.jose.it-berater.org/smfforum/index.php

                        Comment


                        • #13
                          From Jose ...
                          ... did not fully understand about what I have been talking during several years until he bought that monitor.
                          That seems to be the way of life sometimes ... until we need something we don't pay close attention! It seems to work that way for me, not to mention not always recognizing the need until sometime later!

                          Comment


                          • #14
                            Originally posted by Gary
                            That seems to be the way of life sometimes ...
                            ,,, and the same goes for Unicode. A little while ago I shelled wmic and redirected to a file for parsing. All the characters had another character following them. It dawned on me that the output was Unicode and I had to use a wide string as a buffer.

                            The future then is Unicode and high dpi aware. Many of us have some catching up to do. Needless to say José's framework is both Unicode and high dpi aware and since I never did get fully into SDK, using DDT on joining this forum, José's framework is my best bet. When I started using it I could not get WM_InitDialog to work. That was embarrassing. José's framework wraps the SDK - WM_InitDialog is for dialogs,

                            Added: I am off topic now but some of you may find the wmic utility useful, it is only 38.5KB. The console opens momentarily and the parsed info is pushed out via a message box. The % is unused space.

                            Download: DiskSpace.zip
                            Last edited by David Roberts; 7 Oct 2019, 09:45 AM.

                            Comment


                            • #15
                              David Clarke,

                              I tried you sample code on Post #4

                              I added a Manifest with DPI awareness and it cleared up the Fuzziness not sure it will work with all controls.

                              Changed code from post #4
                              Code:
                              #PBFORMS BEGIN INCLUDES
                              '#RESOURCE "NoName.pbr"
                              #RESOURCE MANIFEST,     1, "XPThemeHiDPI.XML"
                              Save as XPThemeHiDPI.XML
                              Code:
                              <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
                              <assembly
                                  xmlns="urn:schemas-microsoft-com:asm.v1"
                                  manifestVersion="1.0"
                                  xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
                              <assemblyIdentity
                                  name="HHHH.exe"
                                  processorArchitecture="x86"
                                  version="0.0.0.0"
                                  type="win32"/>
                              <dependency>
                                  <dependentAssembly>
                                      <assemblyIdentity
                                          type="win32"
                                          name="Microsoft.Windows.Common-Controls"
                                          version="6.0.0.0"
                                          processorArchitecture="x86"
                                          publicKeyToken="6595b64144ccf1df"
                                          language="*"
                                      />
                                  </dependentAssembly>
                              </dependency>
                               <asmv3:application>
                                  <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
                                    <dpiAware>true</dpiAware>
                                  </asmv3:windowsSettings>
                                </asmv3:application>
                              </assembly>

                              Comment


                              • #16
                                Thanks Rod!
                                I will give it a try.

                                Comment

                                Working...
                                X