LB Booster
Programming >> Compatibility with LB4 >> Blitting blank screen. http://lbb.conforums.com/index.cgi?board=compatibility&action=display&num=1394042711 Blitting blank screen.
Post by Rod on Mar 5th, 2014, 5:05pm
Some of my blitting code works, but this code just shows a blank white screen instead of betty boop dancing?
That link just gives me a "This web page can't be displayed" message, so I can't offer any specific advice. In general, though, if you are blitting graphics using the Windows API you need to ensure you execute a wait statement afterwards. See the 'Troubleshooting' section of the LBB docs under "Compatibility with LBB may be impaired if you draw graphics using the Windows API.... ".
Richard.
Re: Blitting blank screen.
Post by Richard Russell on Mar 5th, 2014, 9:53pm
OK, scrub my previous reply. I made a wild guess that perhaps your 'Betty.zip' should have been 'betty.zip', and I was right!
I've now looked at your code and the reason it doesn't work in LBB is that (for reasons I'm not entirely sure of at the moment) the two graphicboxes (#1.gb and #1.sk) are in the wrong Z-order. As a result the animation is hidden behind the skin.
The most straightforward workaround is to forcibly bring #1.gb in front of #1.sk, which you can do by adding this code immediately after the OPEN statement:
Code:
hgb = hwnd(#1.gb)
calldll #user32, "BringWindowToTop", hgb as ulong, r as long
Compatibility with LB 4.04 is not impaired.
Edit: You could have made the 'hole' in skin.bmp the 'transparent' red colour, then the Z-order probably wouldn't have mattered.
Richard.
Re: Blitting blank screen.
Post by Richard Russell on Mar 6th, 2014, 08:21am
You were very unlucky to encounter this bug. It only had an effect if all the following conditions were met:
You create two controls whose Z-order matters (which is usually the case only if they overlap).
Both controls have STYLEBITS statements.
The STYLEBITS statements appear before the statements which create the controls.
The order in which the STYLEBITS statements appear in the program is different from the order in which the controls themselves are created.
Your betty.bas meets those conditions, but it's not very surprising that the bug - which has been present in all versions of LBB to date - has never been spotted previously!