Home › Forums › TWAIN Classic › Delphi Twain
- This topic has 7 replies, 4 voices, and was last updated 16 years, 4 months ago by Keith.
- AuthorPosts
I am currently trying to add a section in a program that i am devoloping in Delphi that allows you to scan a picture into the programme. Does anyone know where i can find a free twain component for delphi or how would i go about it?
Thank you so much
There are a couple of free ones, but they are rubbish and usually require a third-party dll to be included in your distribution. We use a non-free third party tool called Envision, but we have since modified it so much that it is virtually a whole new system.
Before you spend too much time and effort writing your own TWAIN integration check out our Quickscan (http://www.burrotech.com/quickscan.php) – it is a low cost command line scanning utility that supports jpeg, bmp, tif and pdf output as well as allowing you to set resolution, adf, duplex etc.
Paul
Burrotech@Benedictum wrote:
Downloaded this – it appears simple to set up and use… but how can I get it to work with 48 Bit colour – the scanner supports 48Bit colour (Epson V700) but sample application hangs when 48Bit colour selected, and scanned.
Thanks.
What happens on a lower resolution setting? Were you able to scan? What image format are you using? Remember that 48-bit images take a lot of memory.
In the lower Bit depth resolution it works perfectly OK. In the higher bit depth, you can watch the progress bar proceed… but then you get an “Access violation at address 00402851 in module ‘Example.exe’. Write of address 5165729E, when the progress bar is around 1/2 way through.
Looking with the debugger into this address is not that informative – as it doesnt take you into a line of Delphi Code, but into a section of assembly.
It appears to me, that the image is being sent to some block of memory that hasn’t had enough space assigned for the 48Bit image (which will be around 2X that of the standard 24Bit colour I expect.)
It doesnt matter which image format (for transfer I expect you mean) I use, the same problem occurs. Ultimately, I just want to grab one of the RGB colours and then window down into that to process a type of X-ray film.
Keith.
I would look into the OnTwainAcquire event. This is where the bitmap is assign into a holding variable. What I did was to convert the bitmap right into a tJpegImage type variable. I then change the compression and did a conversion to grayscale. This might not be pertinent in your case, just throwing some ideas…
Thanks for the suggestion – heres what happens…
Placing a break point at the TwainTwainAcquire event – the program has failed before this point is reached… so I expect this is only called after the image has been grabbed by the scanner.
As for the Jpeg – I would guess that 48 bits would be stripped down to 24 bits as I am unsure if Jpeg supports 48 Bit colour – but as I am no expert – I could be wrong?
Keith.
- AuthorPosts