Re: PNG image displayed larger in wx widget without any scale change
Alexandra Grigoras <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Igor, I attach image here also, I have generated image just for test with Paint, it has nothing in particular, actually I have notice the issue on matplotlib.figure graphics saved as PNG images. I have same graphic PNG image displayed in 2 tools, one is eclipse GUI based where graphic PNG image is displayed at its real size and a tool with wxPython GUI where same image is displayed larger than it is actually although there are no scale changes made anywhere. Screenshot of wxPython control I have tried is visible in right side of Paint-Wx.png I have already attached. Here are some code sample also: From parent class: self.dataEyesWindow = wx.ScrolledWindow( self.dataEyesPanel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.HSCROLL|wx.VSCROLL ) self.dataEyesWindow.SetScrollRate( 5, 5 ) dataEyesWindowSizer = wx.BoxSizer( wx.VERTICAL ) self.dataEyesWindow.SetSizer( dataEyesWindowSizer ) self.dataEyesWindow.Layout() dataEyesWindowSizer.Fit( self.dataEyesWindow ) dataEyesSizer.Add( self.dataEyesWindow, 1, wx.EXPAND |wx.ALL, 5 ) From child class: data_eyes_gsbmp = wxgbmp.GenStaticBitmap(self.dataEyesWindow, wx.ID_ANY, wx.Bitmap(img_file_path, wx.BITMAP_TYPE_PNG)) self.dataEyesWindow.GetSizer().Add(data_eyes_gsbmp, 0, wx.ALL, 5) Thank you for answering, Alexandra Pe vineri, 12 mai 2023, la 16:05:49 UTC+3, Igor Korot a scris: > Hi, Alexandra, > > > On Fri, May 12, 2023, 7:07 AM Alexandra Grigoras <[email protected]> > 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. > > > Can you build the main C++ library and then its image sample? > > If not - can you attach the image and screenshot of wxPython control you > tried? > > Thank you. > > >> 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/ef0f40fc-1a10-487a-9de1-2642070f960dn%40googlegroups.com.
test_chair.png
(image/png, 53.6 KB) - not displayed