GetClientRect returns wrong values |
Post Reply |
Author | |
Micca
Groupie Joined: 26 November 2008 Status: Offline Points: 22 |
Post Options
Thanks(0)
Posted: 29 June 2012 at 4:06am |
The function GetClientRect returns wrong values for Right and Bottom if the windows text size (DPI) is set to 110%.
The text size 100%, 125% or 150% works fine. With all other text size values the function GetClientRect returns wrong value. I use this code at the resize event of the command bar: cbrMenu.GetClientRect Left, Top, right, bottom picMain.Move Left, Top, right - Left, bottom - Top Example for windows text size (DPI) 100%: You see the black border of the picture box at every side. Example for windows text size (DPI) 110%: The picture box is too large now. The black border of the picture box at the right and bottom is missing. Please can you fix this ugly bug? |
|
Micca
--------------------- Product: Xtreme Commandbars (ActiveX) Version 17.2 Platform: Win7 64bit Language: Visual Basic 6.0 SP6 |
|
Micca
Groupie Joined: 26 November 2008 Status: Offline Points: 22 |
Post Options
Thanks(0)
|
i run the same test with Xtreme Commandbars (ActiveX) v15.3.1 (30 Day Trial).
the bug with the wrong values exist at the newest version too. any feedback from the developers? |
|
Micca
--------------------- Product: Xtreme Commandbars (ActiveX) Version 17.2 Platform: Win7 64bit Language: Visual Basic 6.0 SP6 |
|
Willowmaster
Senior Member Joined: 12 July 2010 Location: Netherlands Status: Offline Points: 180 |
Post Options
Thanks(0)
|
I think it's best if you open a support ticket.
|
|
Product: Xtreme SuitePro (ActiveX) version 15.3.1
Platform: Windows XP (32bit) - SP 3 (on VMWare) Language: Visual Basic 6.0 |
|
DKnowles
Groupie Joined: 03 April 2012 Status: Offline Points: 12 |
Post Options
Thanks(0)
|
Keep us informed if you do get a response Micca. We too are using the function GetClientRect and would be interested to here any response you get.
|
|
Micca
Groupie Joined: 26 November 2008 Status: Offline Points: 22 |
Post Options
Thanks(0)
|
i have created a support ticket at 28-Jul-2012:
The function GetClientRect returns wrong values for Right and Bottom if the windows text size (DPI) is set to 110%. The text size 100%, 125% or 150% works fine. With all other text size values the function GetClientRect returns wrong value. Please check the message at your forum for more details and screenshots: http://forum.codejock.com/forum_posts.asp.TID=19905 i get a reply at 02-Aug-2012: I have check your issue, and it reproduced with 110%, thought only with the bottom ('right' coordinate was ok) Doubled checked the code and it really seems to be fine, it's using Microsoft function TransformCoords http://msdn.microsoft.com/en-us/library/windows/desktop/ms692818(v=vs.85).aspx Which gives some more ole points than needed in non-standard DPI configuration. Looks like a bug of TransformCoords? It was 7 points in my case, so i believe it excludes any floating point to integer conversion loss. Did you tried a workaround: subtracting some space (1-2-3-4-5-6-... ?) from the right/bottom when using 110% DPI? my answer at 03-Aug-2012: Many customer use different DPI settings depending on the screen resoltuion and the real screen size. 110% is just one value i select for testing. If you use a value different than 100,125 or150 creates this problem. I tried to subtract some values but after that i found out that the difference changes after you resize the form. If i make the form larger the difference get higher. After the form gets smaller the difference gets smaller too. No workout for that. I have attached my vb6 test project for you. maybe you can reproduce the problem better. Im testing with win7 64bit. still waiting for any feedback now.... |
|
Micca
--------------------- Product: Xtreme Commandbars (ActiveX) Version 17.2 Platform: Win7 64bit Language: Visual Basic 6.0 SP6 |
|
DKnowles
Groupie Joined: 03 April 2012 Status: Offline Points: 12 |
Post Options
Thanks(0)
|
Thanks for the update
|
|
David
Product: Xtreme Toolkit Version 16.4 Platform: Windows 10 Language: Visual DataFlex 18.2 |
|
PPL1
Groupie Joined: 10 April 2006 Location: Canada Status: Offline Points: 70 |
Post Options
Thanks(2)
|
Hi,
FWIW, 5 years later, I found out that setting the .ScaleMode to pixels fixes the issue. GetClientRect returns the correct client info. Pierre
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |