Page 1 of 2
Problem with item icon
Posted: Thu Sep 22, 2011 12:13 pm
by giammy
I have a problem with items in Treegdaget and ListIconGadget
I use a .png image 16x16 but Treegadget and listicongadget stretch this image to 20x20 (windows 7)
see image please
could someone help me?
thanks in advance
Re: Problem with item icon
Posted: Thu Sep 22, 2011 1:36 pm
by MachineCode
I guess it's stretching it to fit the text height. Not much you can do in that case.
Re: Problem with item icon
Posted: Thu Sep 22, 2011 2:32 pm
by giammy
MachineCode wrote:I guess it's stretching it to fit the text height. Not much you can do in that case.
I used default font
If I decrease the font size the result does not change:

Re: Problem with item icon
Posted: Thu Sep 22, 2011 2:43 pm
by MachineCode
What happens if you increase the font height?
Re: Problem with item icon
Posted: Thu Sep 22, 2011 2:52 pm
by giammy
MachineCode wrote:What happens if you increase the font height?
same result!!

Re: Problem with item icon
Posted: Thu Sep 22, 2011 2:55 pm
by MachineCode
Got me buggered, then.

Re: Problem with item icon
Posted: Thu Sep 22, 2011 4:51 pm
by USCode
I haven't seen this behavior with my 32bit application in Win7 64bit.
Maybe try one of the icons that PB uses and see if it exhibits the same behavior?
http://www.famfamfam.com/lab/icons/silk/
Re: Problem with item icon
Posted: Fri Sep 23, 2011 9:10 am
by giammy
USCode wrote:I haven't seen this behavior with my 32bit application in Win7 64bit.
Maybe try one of the icons that PB uses and see if it exhibits the same behavior?
http://www.famfamfam.com/lab/icons/silk/
same result! the icons are stretched!
suggestions???
Re: Problem with item icon
Posted: Fri Sep 23, 2011 9:52 am
by Kuron
giammy wrote:
I use a .png image 16x16 but Treegadget and listicongadget stretch this image to 20x20 (windows 7)
What is the default size on Windows 7? What is the default size for High-DPI Windows 7 installs?
20x20
sounds "about right" and there is likely a reason Windows 7 is stretching it to 20x20.
Re: Problem with item icon
Posted: Fri Sep 23, 2011 11:17 am
by giammy
Kuron wrote:giammy wrote:
I use a .png image 16x16 but Treegadget and listicongadget stretch this image to 20x20 (windows 7)
What is the default size on Windows 7? What is the default size for High-DPI Windows 7 installs?
20x20
sounds "about right" and there is likely a reason Windows 7 is stretching it to 20x20.
thanks a lot Kuron!!
I found this useful links:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
http://msdn.microsoft.com/en-us/library ... patibility
"Since the introduction of Windows Vista, users are more frequently following the recommended advice to change DPI settings as a way to enlarge the size of the text and UI elements on high-DPI displays. As more manufacturers ship greater numbers of high-resolution displays, the default 96-DPI setting can no longer be assumed by applications"
I wrote this small code to retrieving DPI increasing percentage in windows
Code: Select all
OpenWindow(0,0,0,400,400,"Hello!")
StandardDPIResolution = 96
CurrentDPIResolution = GetDeviceCaps_(GetDC_(WindowID(0)), #LOGPIXELSX)
If CurrentDPIResolution > StandardDPIResolution
IncreasingPercent.d=(CurrentDPIResolution-StandardDPIResolution)/StandardDPIResolution*100
Debug Str(IncreasingPercent)
EndIf
is it a correct approach?
and the question is:
How to write a DPI-aware application to making a UI look consistently good across a wide variety of high-DPI display settings????
(storing different images in the app???)
I have the same problems in other os???
Your suggestions will be greatly appreciated!!!
Re: Problem with item icon
Posted: Fri Sep 23, 2011 1:58 pm
by Kuron
Kuron wrote:there is likely a reason Windows 7 is stretching it to 20x20.
What I was subtly trying to imply is if Windows 7 was going to stretch the images to 20x20, there is likely a reason (what the reason is, I don't know) and it might be best to just use 20x20 images since this appears to be what Windows 7 is wanting.
I am not sure what the reason is, but it really doesn't matter IMHO as knowing the reason doesn't change the fact that Windows 7 appears to be wanting 20x20 images for this. Sometimes it is better to just do what Windows wants and not question the "why".
I am not at my Windows 7 machine so I can't check what size such things are on my machine, but IIRC, they are bigger than "16x16". Perhaps 20x20 is default size for such things now? I don't know.
Re: Problem with item icon
Posted: Fri Sep 23, 2011 2:53 pm
by Kiffi
giammy wrote:suggestions???
just load your 16*16 picture and add a white
two pixel canvas border on each side.
Greetings ... Kiffi
Re: Problem with item icon
Posted: Fri Sep 23, 2011 3:09 pm
by MachineCode
Nice one, Kiffi.
giammy, quite frankly I don't think the image in your first post looks bad at all anyway... so perhaps don't worry so much about it? As a user of your app I'd think it looks fine, and never even question it.
Re: Problem with item icon
Posted: Fri Sep 30, 2011 5:59 pm
by giammy
thanks to all!!

Re: Problem with item icon
Posted: Fri Sep 30, 2011 11:06 pm
by USCode
You didn't happen to turn on the windows 7 text stretch feature, did you? Maybe it's set to 125%? Probably not but it was a thought.