LB Booster
« Overlaying GRAPHICBOXES in window »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:27am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1 2 3  Notify Send Topic Print
 veryhotthread  Author  Topic: Overlaying GRAPHICBOXES in window  (Read 1250 times)
flotulopex
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 94
xx Re: Overlaying GRAPHICBOXES in window
« Reply #21 on: Jul 5th, 2017, 8:26pm »

Using a "graphics" type window, I cant get rid of the title bar.
User IP Logged

Roger
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Overlaying GRAPHICBOXES in window
« Reply #22 on: Jul 5th, 2017, 10:22pm »

on Jul 5th, 2017, 8:26pm, flotulopex wrote:
Using a "graphics" type window, I cant get rid of the title bar.

As you say, there is no built-in window type that supports graphics but which has no title bar. You could presumably use STYLEBITS to create one, or alternatively use a window of type WINDOW_POPUP containing a GRAPHICBOX control, as the program you listed earlier does.

Richard.
User IP Logged

flotulopex
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 94
xx Re: Overlaying GRAPHICBOXES in window
« Reply #23 on: Jul 7th, 2017, 07:57am »

...so is there any solution to draw text over my background or not?
User IP Logged

Roger
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Overlaying GRAPHICBOXES in window
« Reply #24 on: Jul 7th, 2017, 08:30am »

on Jul 7th, 2017, 07:57am, flotulopex wrote:
...so is there any solution to draw text over my background or not?

Both Anatoly (tsh73) and Rod have given you solutions with worked examples. What is stopping you adapting their code to suit your precise requirements? If you were hoping that somebody else would modify your program, I think you will find that most people prefer to give hints and pointers to encourage you to learn for yourself.

Richard.
User IP Logged

Rod
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 110
xx Re: Overlaying GRAPHICBOXES in window
« Reply #25 on: Jul 7th, 2017, 11:44am »

None of the links you provided us with actually lead to runnable code. Even the .exe does not run because of missing graphic resources. If you want us to help with your actual code you will need to zip the .bas file and all needed resources to a folder and share a link to that. Put everything in a new folder Right Click on it and choose Send To then choose zipped folder. Now put the .zip somewhere we can share.
User IP Logged

tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Overlaying GRAPHICBOXES in window
« Reply #26 on: Jul 7th, 2017, 11:50am »

I did run the EXE (may be it was previous version) but alas my montor works only up to 1280x1024, so I cannot work with program written to 1900xsomething.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Overlaying GRAPHICBOXES in window
« Reply #27 on: Jul 7th, 2017, 12:45pm »

on Jul 7th, 2017, 11:44am, Rod wrote:
If you want us to help with your actual code you will need to zip the .bas file and all needed resources to a folder and share a link to that.

Or use LBB's capability of embedding the resource files in the EXE (they are compressed when you do that)!

Richard.
User IP Logged

flotulopex
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 94
xx Re: Overlaying GRAPHICBOXES in window
« Reply #28 on: Jul 7th, 2017, 2:03pm »

Rod, I already posted my full code in previous post in this thread wink

Nevertheless, I have zipped all the files again and here is the link the this file: http://home.citycable.ch/flotulopex/LBB/ZIPped/

Thanks a lot for the already provided solutions. Unfortunately, I can't use "graphics" type window as I can't get rid of the title bar (or did I miss something?).

The resolution of 1920x1080 is due to the fact that this program is displaying via a beamer on a quite big screen (3m x 1m70). I already tested with lower resolution but the images look crap embarassed
User IP Logged

Roger
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Overlaying GRAPHICBOXES in window
« Reply #29 on: Jul 7th, 2017, 2:45pm »

on Jul 7th, 2017, 2:03pm, flotulopex wrote:
Unfortunately, I can't use "graphics" type window as I can't get rid of the title bar (or did I miss something?).

Yes, you evidently missed my reply in which I stated that you can either use STYLEBITS to remove the title bar or alternatively use a WINDOW_POPUP containing a GRAPHICBOX control. There's not much to choose between these solutions.

I know that Conforums doesn't always reliably list all replies in the "10 most recent posts on this forum" summary, but if you go directly to the thread you should find them.

Quote:
The resolution of 1920x1080 is due to the fact that this program is displaying via a beamer on a quite big screen (3m x 1m70).

Ideally your program should adapt to the current DisplayWidth and DisplayHeight values, that way anybody will be able to run it. Even if the text and image quality is poor on smaller screen sizes, that way you are more likely to receive offers of help.

Richard.
User IP Logged

flotulopex
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 94
xx Re: Overlaying GRAPHICBOXES in window
« Reply #30 on: Jul 7th, 2017, 2:54pm »

Thanks Richard wink
User IP Logged

Roger
Rod
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 110
xx Re: Overlaying GRAPHICBOXES in window
« Reply #31 on: Jul 8th, 2017, 09:06am »

Ok, your code is still not showing me what's wrong because of the screen size. Can you put together a very simple demo of what the problem is using a small 800x600 screen. You don't need a bunch of code just enough to show us what it is about the statictexts and bmps and text rendering that isn't working for you.

Even try adapting my demo to show your problem.
User IP Logged

flotulopex
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 94
xx Re: Overlaying GRAPHICBOXES in window
« Reply #32 on: Jul 9th, 2017, 11:38am »

Hi Rod,

Thanks for helping wink

Here's the link to a minimized piece of code in a (for you) 800x600 pixels resolution of what I want to achieve.

http://home.citycable.ch/flotulopex/LBB/800x600.zip

For any reason I don't understand right now, it's working (!!!) meaning: I can now overlay a statictext over a bmp backround. I started to search my original code why it is not working there.

If you still want to test it, run it and left-click anywhere on the left side of your screen will make some text appear while left-clicking on the right will make it disappear.
« Last Edit: Jul 9th, 2017, 11:41am by flotulopex » User IP Logged

Roger
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Overlaying GRAPHICBOXES in window
« Reply #33 on: Jul 9th, 2017, 12:01pm »

on Jul 9th, 2017, 11:38am, flotulopex wrote:
For any reason I don't understand right now, it's working (!!!) meaning: I can now overlay a statictext over a bmp backround.

I'm not enthusiastic about doing that. It is reliant on the window Z-order and on the correct use of the WS_CLIPCHILDREN stylebit, and whilst this should work it seems to be taking an unnecessary risk.

The LB 4 Help file specifically states "Some controls do not work properly when placed in graphicboxes or graphics windows. If there is a need for text display within a graphicbox or graphics window, use the graphics text capabilities rather than a statictext control". Although LBB makes no such stipulation, there is a danger that you may break compatibility with LB 4.

Also, in order to make the edge of the STATICTEXT control invisible you must precisely match its background color to the BMP 'behind', and whilst you can do this in LBB (because the BackgroundColor$ variable can take an RGB parameter) in LB 4 you can't.

Obviously I don't think retaining LB 4 compatibility is that important, but neither do I encourage unnecessarily breaking it.

Richard.
User IP Logged

flotulopex
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 94
xx Re: Overlaying GRAPHICBOXES in window
« Reply #34 on: Jul 9th, 2017, 12:03pm »

The simple version just posted a few minutes ago works well because it is ultra-simple...but I can't use it.

I'm now trying to display both texts in different colors and trouble begins.

Let's try to solve problems one-by-one. Here is another piece of code, still 800x600 pixels where I display now 2 texts.

http://home.citycable.ch/flotulopex/LBB/800x600_colors.bas

How do I do this?
User IP Logged

Roger
flotulopex
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 94
xx Overlaying GRAPHICBOXES in window
« Reply #35 on: Jul 9th, 2017, 12:11pm »

on Jul 9th, 2017, 12:01pm, Richard Russell wrote:
The LB 4 Help file specifically states "[i]Some controls do not work properly when placed in graphicboxes or graphics windows.

I will not be able to use a graphics type window anyway since I can't get rid of the title bar embarassed
User IP Logged

Roger
Pages: 1 2 3  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls