Problem with item icon

Everything else that doesn't fall into one of the other PB categories.
giammy
User
User
Posts: 16
Joined: Wed Aug 03, 2011 10:43 am

Problem with item icon

Post 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
Image


could someone help me?

thanks in advance
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Problem with item icon

Post by MachineCode »

I guess it's stretching it to fit the text height. Not much you can do in that case.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
giammy
User
User
Posts: 16
Joined: Wed Aug 03, 2011 10:43 am

Re: Problem with item icon

Post 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:

Image
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Problem with item icon

Post by MachineCode »

What happens if you increase the font height?
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
giammy
User
User
Posts: 16
Joined: Wed Aug 03, 2011 10:43 am

Re: Problem with item icon

Post by giammy »

MachineCode wrote:What happens if you increase the font height?
same result!!
Image
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Problem with item icon

Post by MachineCode »

Got me buggered, then. :)
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Re: Problem with item icon

Post 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/
giammy
User
User
Posts: 16
Joined: Wed Aug 03, 2011 10:43 am

Re: Problem with item icon

Post 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! :(

Image

suggestions???
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: Problem with item icon

Post 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.
Best wishes to the PB community. Thank you for the memories. ♥️
giammy
User
User
Posts: 16
Joined: Wed Aug 03, 2011 10:43 am

Re: Problem with item icon

Post 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!! :D :D

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!!!
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: Problem with item icon

Post 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.
Best wishes to the PB community. Thank you for the memories. ♥️
User avatar
Kiffi
Addict
Addict
Posts: 1485
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Problem with item icon

Post by Kiffi »

giammy wrote:suggestions???
just load your 16*16 picture and add a white
two pixel canvas border on each side.

Greetings ... Kiffi
Hygge
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Problem with item icon

Post 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.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
giammy
User
User
Posts: 16
Joined: Wed Aug 03, 2011 10:43 am

Re: Problem with item icon

Post by giammy »

thanks to all!! :wink: :wink:
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Re: Problem with item icon

Post 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.
Post Reply