LB Booster
« problem with AVICAP and LBB »

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



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  Notify Send Topic Print
 hotthread  Author  Topic: problem with AVICAP and LBB  (Read 2021 times)
pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx problem with AVICAP and LBB
« Thread started on: Jun 25th, 2014, 5:21pm »

Hi to all.
I'm not an expert programmer and for the first time I attempt with the video.
I'm having trouble converting the program VidCapLB by Callum Lowcay with LBB.
The program after connecting the webcam show only a still image and not respond to any event including the closure of the main window.

In an attempt to understand the problem, I realized that everything works until you try closing the window "Choose" at the end of the sub "ChooseDevice".
In fact:
1) If I put (for test) the instructions
Choose.cancel #, "!Disable"
wait
immediately after DevNum = DevNum-1 the program feels the closures of both the windows Choose and main
2) If I put the same instructions before close #Choose the program feels only the close event of the #main window (not the closure of #Choose);
3) If I try to insert (for test) the instructions
Main.CapStill #, "! Disable"
wait
immediately after the return from the sub "ChooseDevice" the program no longer feels any event also if the button "CapStill" is correctly disabled.

The source code for VidCapLB (too big to put here) can be downloaded from http://callumscode.com/old_projects/.

This code work fine under LB4 and win7 x 64 pro with internal webcam of my laptop Dell.

Thank you very much for any indication
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: problem with AVICAP and LBB
« Reply #1 on: Jun 25th, 2014, 6:28pm »

on Jun 25th, 2014, 5:21pm, pierscintilla wrote:
Thank you very much for any indication

I have explained this before. LBB will not work with arbitrary DLLs because - unlike LB - it is not a single-threaded application. DLLs are quite often fussy about which thread they are called from (the GUI thread or the interpreter's thread) - so I must set this individually for each DLL.

I don't believe that anybody has previously told me that they wish to use LBB with AVICAP, so it has not been configured for that DLL. I will make a note to do that for the next release.

Richard.
User IP Logged

pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx Re: problem with AVICAP and LBB
« Reply #2 on: Jun 25th, 2014, 7:14pm »

Incredible speed!
Thank you very much and look forward to ...
User IP Logged

pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx Re: problem with AVICAP and LBB
« Reply #3 on: Jun 25th, 2014, 9:18pm »

If you're interested, it would be nice to include in the list of dll supported by lbb also all those that are contained in the file YoingcoDLLs.zip (https://groups.yahoo.com/neo/groups/lbfiles/files/DLLs/).
They are all very interesting, especially the Comalexcel.dll which can produce excel file..
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: problem with AVICAP and LBB
« Reply #4 on: Jun 26th, 2014, 06:04am »

on Jun 25th, 2014, 9:18pm, pierscintilla wrote:
If you're interested, it would be nice to include in the list of dll supported by lbb

I can consider providing a list, but I must emphasise that if a DLL isn't on the list it doesn't mean it won't work - it simply means it might not work.

Some DLLs, especially those that don't in themselves provide a GUI, are not fussy about what thread they are called from, and will 'just work' without any effort from me. So it is always worth trying it first.

The ones that often won't work, without me making special provision in LBB, are commonly those which create their own windows. And of course AVICAP does create a 'capture window'.

Richard.
User IP Logged

pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx Re: problem with AVICAP and LBB
« Reply #5 on: Jun 26th, 2014, 09:25am »

Ok. Thank you very much.
For Comalexcel I tried it and it does not work. This DLL (like the one on the same list that interfaces with WORD) could open the doc or xls documents by using the appropriate application.

Pier
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: problem with AVICAP and LBB
« Reply #6 on: Jun 26th, 2014, 1:18pm »

on Jun 26th, 2014, 09:25am, pierscintilla wrote:
could open the doc or xls documents by using the appropriate application.

Why do you need a DLL for that? The ShellExecute API is the correct way to open a document using the registered application for the file type (e.g. Word for .doc and Excel for.xls). That works fine from LBB, of course.

I would not recommend using DLLs which have been developed simply as a workaround to LB's limitations. For example there's a DLL which can be used to access COM Automation objects, but since you can do it directly from LBB without any DLL that's preferable.

Richard.
User IP Logged

pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx Re: problem with AVICAP and LBB
« Reply #7 on: Jun 26th, 2014, 7:40pm »

I beg your pardon. I have not explained properly. Actually I use ShellExecute to open a document with a registered application but I use Comalexcel (and its equivalent for Word) only to GENERATE and/or to MODIFY Excel or Word files.
I was talking about opening documents just to say that the only GUI that is used by the DLL mentioned is of the application (which I think is not to be considered for the problems of working with LBB).

Pier
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: problem with AVICAP and LBB
« Reply #8 on: Jun 30th, 2014, 08:53am »

I have updated LBB to version 2.62, which incorporates the necessary modification to ensure compatibility with AVICAP32.DLL:

http://www.lbbooster.com/LBB.exe
http://www.lbbooster.com/LBBRUN.exe

The VidCapLB program now runs correctly for me on my Windows XP machine. It doesn't run on my Windows 8.1 notebook, but neither does it run in LB 4.04 so that appears to be a different issue.

Richard.
User IP Logged

pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx Re: problem with AVICAP and LBB
« Reply #9 on: Jul 1st, 2014, 5:02pm »

Hello.
Thank you very much for the alert. Now, with version 2.63, the Avicap problem is solved.
It can also be with the version 6.22 but I did not tested.
I must to give you a monument!
However, I have discovered another problem:
It seems that GETBMP or BMPSAVE not works.
I copy a part of the image of the camera and go to put this in a file "temp.bmp" with the following lines:

PRINT # main, "getbmp screen 40 40 320 240"
BMPSAVE "screen", "temp.bmp"

but the image in the file is completely white ..

Many thanks
Pier
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: problem with AVICAP and LBB
« Reply #10 on: Jul 1st, 2014, 6:01pm »

on Jul 1st, 2014, 5:02pm, pierscintilla wrote:
It seems that GETBMP or BMPSAVE not works.

The GETBMP command doesn't read the 'screen', it reads the 'graphics window'. This is documented in the Liberty BASIC help file: "This command will make a bitmap copied from the graphics window at x, y and using width and height".

A feature of LB 4.04 is that the GETBMP command doesn't actually do what the docs say - instead of copying from the graphics window it copies from the screen. This is normally undesirable, because it means if the graphics window is covered by another window GETBMP doesn't work correctly. I have fixed this fault in LBB.

It sounds as though your program relies on LB's faulty behaviour, but it should never have worked. You will need to read the screen using a 'legitimate' method, for example by using the BitBlt API (that will work in LB, too).

It would be neither sensible nor desirable for LBB to reproduce all LB's quirks, especially those which contradict the documentation. Sorry.

Richard.
User IP Logged

pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx Re: problem with AVICAP and LBB
« Reply #11 on: Jul 1st, 2014, 6:20pm »

Remarks absolutely shared.
Actually I realized that GETBMP copy the screen and not the graphics window, and this was a problem even if I have accepted the strange behavior.
Now I will try with BitBlt although for me (not a good programmer), is a little more complicated.
Thanks again
Pier
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: problem with AVICAP and LBB
« Reply #12 on: Jul 1st, 2014, 6:32pm »

on Jul 1st, 2014, 6:20pm, pierscintilla wrote:
Now I will try with BitBlt although for me (not a good programmer), is a little more complicated.

If you want to save a still-frame to a bitmap file, can't you simply send the WM_CAP_FILE_SAVEDIB message:

http://msdn.microsoft.com/en-gb/library/windows/desktop/dd743900.aspx

Richard.
User IP Logged

pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx Re: problem with AVICAP and LBB
« Reply #13 on: Jul 1st, 2014, 7:24pm »

Help fantastic.
thank you very much!!!!!!!!!!!
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: problem with AVICAP and LBB
« Reply #14 on: Jul 1st, 2014, 8:28pm »

on Jun 25th, 2014, 9:18pm, pierscintilla wrote:
If you're interested, it would be nice to include in the list of dll supported by lbb

I have created a page on the Wiki listing those DLLs that I know to be compatible (or incompatible) with LBB:

http://lbbooster.wikispaces.com/DLLs+compatible+with+LBB

This is of course a community-editable Wiki so can I ask that anybody with additional information adds to the page. If you find a DLL which doesn't work with LBB, but you would like it to, please also post a request here.

Richard.
User IP Logged

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

| |

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