dynarithmic / twain_library

Dynarithmic TWAIN Library, Version 5.x
Apache License 2.0
60 stars 25 forks source link

Save multiple images to a file path and without overwriting existing image file #15

Closed KBDevLab closed 3 years ago

KBDevLab commented 3 years ago

How would I go about saving all the scanned images individually in the collection to a specified path?

When I save the images now, it will only save 1 of the many images scanned.

dynarithmic commented 3 years ago

There are 3 ways to do this:

  1. Use DTWAIN_SetFileAutoIncrement to auto-increment the file names

  2. DTWAIN_AcquireFileEx if you have a set of names.

  3. Trap the DTWAIN_TN_FILENAMECHANGING notification using a callaback and call the DTWAIN_SetSaveFileName function.

dynarithmic commented 3 years ago

Also, is documented here near the bottom of the page.

KBDevLab commented 3 years ago

I’m so sorry, I’m a bit new to development, so when you call those methods...where I’m there do you tell it where you want to save the images that we’ve acquired?

Like where do you specify the path?

On Sep 15, 2020, at 9:26 AM, Paul McKenzie notifications@github.com wrote:

 Also, is documented here near the bottom of the page.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

dynarithmic commented 3 years ago

Give the full path name in the second argument in the call.

DTWAIN_AcquireFile(Source, "SomePath\SomeFolder\SomeSubFolder\test000.bmp", etc.)

Which reminds me, there is a fourth way to specify the file names:

List the files separated by a space or semicolon in the call to DTWAIN_AcquireFile:

DTWAIN_AcquireFile(Source, "SomePath\SomeFolder\SomeSubFolder\test000.bmp SomePath\SomeFolder\SomeSubFolder\test001.bmp", etc.)

KBDevLab commented 3 years ago

I love you....seriously thank you.

On Sep 15, 2020, at 11:10 AM, Paul McKenzie notifications@github.com wrote:

 Give the full path name in the second argument in the call.

DTWAIN_AcquireFile(Source, "SomePath\SomeFolder\SomeSubFolder\test000.bmp", etc.)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

dynarithmic commented 3 years ago

No problem. Glad to help.