Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Images compiled into an xrc show up incorrectly in wxMac on Intel

0 views
Skip to first unread message

William H. Schultz

unread,
Jan 18, 2006, 4:54:56 PM1/18/06
to
Hello!

I have a toolbar that is compiled into a cpp file, which in turn is
compiled into the application and loaded at startup. This has worked
correctly on both wxMAC/ppc and wxMSW. Also, the cpp files create by
wxrc on the Mac and on Windows are virtually identical and can be
used on either platform. I set up the minimal app to load the
toolbar, and I get the same purple toolbar in this application as I
do on our app.

My hunch is that there is an endianness mangling that occurs
somewhere between the wxMemoryFSHandler::AddFile() and LoadToolBar().

I'm still looking to see if I can find the issue myself, but I'm
curious if anyone else has run into this issue (or even fixed it
already).


Thanks,


Hank Schultz
Cedrus Corporation
http://www.cedrus.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
For additional commands, e-mail: wx-use...@lists.wxwidgets.org

William H. Schultz

unread,
Jan 18, 2006, 8:15:25 PM1/18/06
to
Another detail I just found: I have other images loaded into the
program the same way, but they work correctly. This implies the
issue may be specific to wxToolbar.


Hank Schultz
Cedrus Corporation
http://www.cedrus.com/

William H. Schultz

unread,
Feb 8, 2006, 6:33:22 PM2/8/06
to
I have finally gotten one step further.  There appears to be an endianness problem in wxBitmapRefData::GetIconRef(), but I haven't been able to pinpoint what the code should be.  Changing the inner for-loop to the following fixes most, but not all, of my toolbar icons:

                for ( int x = 0 ; x < w ; ++x )
                {
#ifdef WORDS_BIGENDIAN
a = *source ++ ;
r = *source ++ ;
g = *source ++ ;
b = *source ++ ;
#else
b = *source ++ ;
g = *source ++ ;
r = *source ++ ;
a = *source ++ ;
#endif
                    *dest++ = 0 ;
                    *dest++ = r ;
                    *dest++ = g ;
                    *dest++ = b ;

                    if ( mask )
                    {
#ifdef WORDS_BIGENDIAN
*maskdest++ = 0xFF - *masksource++ ;
#endif
                        masksource++ ;
                        masksource++ ;
                        masksource++ ;
#ifndef WORDS_BIGENDIAN
*maskdest++ = 0xFF - *masksource++ ;
#endif
                    }
                    else if ( hasAlpha )
                        *maskdest++ = a ;
                    else
                        *maskdest++ = 0xFF ;
                }

I've tried all kinds of other crazy things, like using xpm instead of png, but none of this stuff fixes my problem.  Also, the above code change breaks the toolbar sample, so I know it isn't the right fix, but since it makes my toolbar look (almost) normal again, I can tell it's definitely a step in the right direction.



Hank Schultz
Cedrus Corporation



Stefan Csomor

unread,
Feb 9, 2006, 12:12:53 AM2/9/06
to
Hi Hank
 
could you send me the .cpp that poses problems, we've had to change things in order to have masks work properly on intel machines, so maybe I've missed something ...
 
Thanks,
 
Stefan


From: William H. Schultz [mailto:whsc...@cedrus.com]
Sent: Donnerstag, 9. Februar 2006 00:33
To: wx-u...@lists.wxwidgets.org
Subject: Toolbar icons show up incorrectly in wxMac on Intel

0 new messages