Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Cant capture a BMP image.
Author | Message | ||||
aargee Senior Member Joined: 21/08/2008 Location: AustraliaPosts: 255 |
Geoff, I can't seem to capture a BMP image with the SAVEBMP command. It reports that the file is already open (sorry, can't remember the exact text), even when I use different file names for the first time. I've checked the syntax several times and it seems OK. I'm using version 2.6 with Com. Port 1 running at 19k2 into a VGA monitor. Can someone try it out and post the piece of code if it works? Thanks, Rob. For crying out loud, all I wanted to do was flash this blasted LED. |
||||
BobDevries Senior Member Joined: 08/06/2011 Location: AustraliaPosts: 266 |
Aargee, I used this code snippet: 10 OPEN "COM1:19200" AS #5 20 CLS 30 CIRCLE(50,50),10 40 SAVEBMP"COMTEST" 50 CLOSE #5 That works fine, no errors. Regards, Bob Devries Dalby, QLD, Australia |
||||
aargee Senior Member Joined: 21/08/2008 Location: AustraliaPosts: 255 |
Aah, might have spotted the problem, I'm putting a space between SAVEBMP and "filename" (the manual shows a space as well?) I'll give it a go when I get home tonight. Thanks, Bob. - Rob. For crying out loud, all I wanted to do was flash this blasted LED. |
||||
BobDevries Senior Member Joined: 08/06/2011 Location: AustraliaPosts: 266 |
Aargee, I tried that with a space between SAVEBMP and the filename, but still no error. Can you post some code to show what you're doing? Someone else may notice a flaw? Regards, Bob Devries Dalby, QLD, Australia |
||||
aargee Senior Member Joined: 21/08/2008 Location: AustraliaPosts: 255 |
Hmm, I don't know if it is a bug, but I had the com port open as #1 and it errors. If I use Com port as #5 all is well!? The manual uses #1 as an example of Com port usage but it must interfere with the BMP storage routine. Geoff - is it a bug? - Rob. For crying out loud, all I wanted to do was flash this blasted LED. |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
opening the com port as #1 or #2 generates the file open error, #3 and #5 work ok on mine. Anthony, |
||||
BobDevries Senior Member Joined: 08/06/2011 Location: AustraliaPosts: 266 |
I can confirm that problem. I changed my snippet to use #1, and kablooie! Error line 40: File number is already open In my view, any internal command (such as SAVEBMP) should not use a file number that's usable by user programmes. My $0.02 + GST Regards, Bob Devries Dalby, QLD, Australia |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
Ah, another bug found and squashed! Thanks everyone, that was a subtle bug indeed. The SAVEBMP does a scan of the file table to find a free file number... and got it wrong. I have fixed it and the fix will appear in the next version, until then the workaround is to avoid using the file numbers #1 or #2 if you are also using the SAVEBMP command. This really illustrates how hard it is to test for bugs these days. The bug only occurred in rare circumstances and I never thought to test the command with a range of different file numbers open at the same time. Geoff Geoff Graham - http://geoffg.net |
||||
aargee Senior Member Joined: 21/08/2008 Location: AustraliaPosts: 255 |
Thanks, Geoff, glad we could help !! For crying out loud, all I wanted to do was flash this blasted LED. |
||||
Print this page |