Anyone used EZTWAIN + DELPHI + TImage components?

Hello all,

I am creating a project where the user can scan a diagram, and save it
to file in the appropriate directory(s).

I am using twain to do this compliments of EZTWAIN.DLL and EZTWAIN.PAS.

EZTWAIN acquires the image as a HBitmap type.

I first could not figure out how to pass this bitmap to the TImage
component as is using the HBitmap Handle, so I Write it to a temporary
file using a function in the .DLL ---


I pass the HBitmap handle, and a filename (TempScan.BMP) to the function
to save it to a temporary file on disk, and then reload it into the
TImage component.

This seemed to work fine until I realized the file I later wrote to disk
using the TImage procedure TImage.Bitmap.WriteToFile(aFilename) was
writing the bitmap to a file over 10 times the original size!

If I scan, and use the EZTWAIN procedure mentioned above to save the
image to "TempScan.bmp" and the file it let's say, 277k..  After using
the TImage method LoadFromFile() and then WriteToFile() creates a bitmap
in excess of 6 megs!

Can someone please tell me why this might be happening?

Please respond E-mail as well as in the News Forum..

Thanks so much!


         ( 0 0 )
Reid Roman
E-Mail :
Delphi Enthusiast, Hobbiest ..