Re: PNG image displayed larger in wx widget without any scale change

Maarten Bent <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
Hi,

Do you use a non-standard DPI? Like 125% or 150% scaling in Windows.
The 100% in paint is really unreliable with this. See my attached 
picture where I made a screenshot of the widgets sample (fullscreen 
1920x1040 on a monitor with normal/100% scaling).
Then I past it in paint (same monitor, also fullscreen 1920x1040). You 
would expect it to fill (even overfill) the entire paint window, but it 
fills only 2/3ths.
Even though it shows the correct number of pixels, and 100%, it is too 
small. This probably happens because the scaling of my main monitor is 150%.

tldr: you can't trust the 100% in paint.

Secondly, images in wxStaticBitmap will automatically scale to the 
display DPI when per-monitor DPI is enabled.

Maarten


On 12-5-2023 13:19, Alexandra Grigoras wrote:
> Hi all,
>
> I have a problem figuring out why PNG image is displayed larger in a 
> wx widget than its actual size without making any scale change(Python 
> 3.10, wxpython 4.2.0, Windows 10). I have tried 
> wx.ScrolledWindow/wx.Panel with wxStaticBitmap, 
> wx.lib.statbmp.GenStaticBitmap and overwrite of 
> wx.lib.statbmp.GenStaticBitmap's OnPaint method and debugged height, 
> width and scale members on every object up to wx.DC and I have not 
> found any explanation: height and width are actual height and width  
> the image and scale is 1.0. I have attached picture where in left size 
> is image with its real size and in right side is how it is displayed 
> in wx.ScrolledWindow.
> I would need first to understand why PNG image is displayed larger in 
> a wx widget than its actual size and second to display PNG image in 
> wx.ScrolledWindow at its actual real size.
>
> Regards and thank you in advance,
> Alexandra
> -- 
> Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
> ---
> You received this message because you are subscribed to the Google 
> Groups "wx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/wx-users/3eb7390c-6e26-4169-85b9-084b284f8eaen%40googlegroups.com 
> <https://groups.google.com/d/msgid/wx-users/3eb7390c-6e26-4169-85b9-084b284f8eaen%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/64912e9f-c5e5-b42b-745f-d56806e793fc%40gmail.com.
Screenshot 2023-05-12 153236.png (image/png, 181.7 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.