Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Looking for help with saving multiple Image Grabs wih inc filenames

Author
Message
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 18th Oct 2010 23:06
Hi,

Need some help with being able to incremently saving an Image via the Grab Image command, to an incrementing filename. i.e


If Image Exist(300)=1 then delete image 300
Get image 300,0,0,469,319,1
save image "TimingFilename01.jpg",300


Not sure of format to allow increment of filename i.e 01,02 etc.?

So I end up with say 10 file names TimingFilename01.jpg to TimingFilename50.jpg
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 18th Oct 2010 23:37
Hi,

You might want to keep an extra variable that increases each 'grab'. Something like this:



If you want to format the text, I don't think it should be that hard using a few ifs and thens.

Cheers!
Sven B

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Oct 2010 23:47
Using the PADLEFT$() function from my plug-ins:


Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 19th Oct 2010 07:31
Also you don't need this:



There's no need to delete images. Any time you grab an image with an image number that already exists it's replaced with the new image.

DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 19th Oct 2010 13:37
Great thanks
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Oct 2010 15:26
Oops, that code should be:


Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet

Login to post a reply

Server time is: 2026-07-22 03:51:46
Your offset time is: 2026-07-22 03:51:46