I am having problems displaying certain images with both
wx.StaticBitmap and wx.GenStaticBitmap. The images simply
don't display despite they are loaded just fine from the
file. It doesn't depend on the file type - say, one .png
displays OK while another one does not with the very same
wxPython code.
I am guessing there must be subtle differences with
transparency, certain image format options, etc but my
Google Fu wasn't strong enough to find relevant threads -
can anyone point me in the right direction ?
Please make a runnable, small as possible, sample application that demonstrates the problem, attach it to your mail, and let us know the platform and wx version. MakingSampleApps - wxPyWiki
···
On 7/21/11 1:02 PM, Karsten Hilbert wrote:
I am having problems displaying certain images with both
wx.StaticBitmap and wx.GenStaticBitmap. The images simply
don't display despite they are loaded just fine from the
file. It doesn't depend on the file type - say, one .png
displays OK while another one does not with the very same
wxPython code.
I am guessing there must be subtle differences with
transparency, certain image format options, etc but my
Google Fu wasn't strong enough to find relevant threads -
can anyone point me in the right direction ?
I do notice that the problematic images show fine in the
ImageFromStream example of the wxPython 2.8.11 demo.
It does show in the ImageBrowser of the demo.
Modifying the ImageFromStream example to use GenStaticBitmap
(which is what GNUmed uses) displays the images fine, too.
So it, indeed, seems to be a function of how GNUmed uses the
image/bitmap classes.
For what it is worth I am attaching the modified
ImageFromStream.py from the demo plus two images, one of
which works in GNUmed while the other does not.
Maybe someone can spot a difference with the image files
right away ?
On Thu, Jul 21, 2011 at 02:43:31PM -0700, Robin Dunn wrote:
On 7/21/11 1:02 PM, Karsten Hilbert wrote:
>I am having problems displaying certain images with both
>wx.StaticBitmap and wx.GenStaticBitmap. The images simply
>don't display despite they are loaded just fine from the
>file. It doesn't depend on the file type - say, one .png
>displays OK while another one does not with the very same
>wxPython code.
>
>I am guessing there must be subtle differences with
>transparency, certain image format options, etc but my
>Google Fu wasn't strong enough to find relevant threads -
>can anyone point me in the right direction ?
Please make a runnable, small as possible, sample application that
demonstrates the problem, attach it to your mail, and let us know the
platform and wx version. MakingSampleApps - wxPyWiki
We do a rescaling of the wx.Image() before turning it into a
wx.Bitmap() and showing it. The height to rescale to is
pre-defined and the width is calculated:
This, of course, will rescale to a width of 0 if the current
width is less than the current height... (look up the /
operator behaviour on integers). No wonder I can't see the
images
Karsten
···
On Fri, Jul 22, 2011 at 11:30:42AM +0200, Karsten Hilbert wrote:
> >I am having problems displaying certain images with both
> >wx.StaticBitmap and wx.GenStaticBitmap. The images simply
> >don't display despite they are loaded just fine from the
> >file. It doesn't depend on the file type - say, one .png
> >displays OK while another one does not with the very same
> >wxPython code.
> >
> >I am guessing there must be subtle differences with
> >transparency, certain image format options, etc but my
> >Google Fu wasn't strong enough to find relevant threads -
> >can anyone point me in the right direction ?
>
> Please make a runnable, small as possible, sample application that
> demonstrates the problem, attach it to your mail, and let us know the
> platform and wx version. MakingSampleApps - wxPyWiki