Using a scanner

Hi experts!

I have to recieve an image from the scanner and save it as TIFF. So I need to find some dll or a component or an OCX -whatever.
This should be done from Delphi of course.

Do you know where I can find something or how to make one(of course for much more points!!!)?

Thanks!

Regards,
Matvey
LVL 3
MatveyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

interCommented:
Hi friend,

For SCSI scanners the way to scanning is an interface DLL called TWAIN. But, I want to ask if you have a image manupulation and format conversion application? If so, there is a marvelous OCX from Accusoft called ImageGear. It has even image processing and enhancement functions, but it is expensive. Please describe your need more?

Bye
Igor
0
ZifNabCommented:
Yo Matvey,

On Super Delphi Page and/or Torry's Page there is called a component which interacts with Twain DLL...

Regards, Zif.
0
ZifNabCommented:
Yo Matvey,

On Super Delphi Page and/or Torry's Page there is called a component which interacts with Twain DLL...

Regards, Zif.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

MatveyAuthor Commented:
Hi guys,

I heard about ImageGear...and about it's price. In fact I didn't know it does some kind of job for scanners...

Anyway, my task seems to be simpler: all I need is to scan and save.

ZifNab -thanks. I'll look at it today.
0
OdieCommented:
I had the same problem and I used the Wang-Image scanning control that comes with any new version of Windows.  It's an ocx control which envokes the twain-stuff and let's the user selected the area to scan, resolution etc.  It also let's the programmer select to save the image as jpeg, tiff or bmp.
It's easy to use for the programmer.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MatveyAuthor Commented:
Odie, what do you mean any new Win. ver? Where exactly I can find this OCX?

Thanks!!!
0
interCommented:
Hi Matvey,

The WangImage controls are installed in any WinNT 4.0 version as far as I know. For Win95 they are not standard components but available with Plus kit. So if you are running NT 4.0 and Delphi 2.0+, you should see them in registered OCX. Just install them to VCL.  But I do not use them before, so Odie may help with code fragments.

Bye friend, (I'll send you the TSortGrid and TCheckGrid, sorry for the delay)
Igor
0
MatveyAuthor Commented:
Hi all!

To be clear:
I'm using Win95 with Delphi 3 pro.
I got the "Plus!" thing

I'll try to search for it (wang...) wherever it is, but my last atempt was unseccessful

My task now looks like this:
I have to make a sort of DLL file that will have a procedure that recieves a filename, scans  a paper and saves it to this file.

*The file is TIFF

*I think I should use TWAIN (whatevr it is -I don't really know...)

What I've got so far it's a shareware delphi component that can NOT write TIFF, for it I'll need some sort of file convertion component. (do you know any???)

I also have now the idea of WANG that Odie sugested. -Again very unclear situation.

So...what do you say? let's make it clear??

THANK YOU ALL SO MUCH!!!

PS Inter, Zif sent me the SortGrid, but not the others -thanks!
0
ZifNabCommented:
Yo Matvey, that TWAIN thing is a DLL file...
0
MatveyAuthor Commented:
:-) It might be whatever animal, but my task is to make a procedure that uses it as I described.

Can you help?
0
OdieCommented:
Sorry it took me so long to answer (and my previous thing was meant to be a comment - wrong button).  With new version I mean that the first version of windows 95 didn't have the component but the OSR2 release for example does.  It is installed when you check the installation option 'Imaging'.
And it does automatically convert the scanned image to tif/jpg/bmp.
0
MatveyAuthor Commented:
Yes! I found it! although I had no "Wang Imaging" with my w95, I found the separate Install!

Now I need two things:
Maybe you can send me some example you have made with this? It'll be really helpfull!
And I need to know if I can freelly use imaging OCXes and destribute them.

Thanks alot Odie!
Matvey

my email: bosism@netvision.net.il
0
OdieCommented:
This is the core code of the stuff.  This is only testing code (I use a constant path c:\y.bmp e.g.).  Note that some properties set with the object inspector are 'forgotten' by the component so I set these things again at run time (compressiontype and filetype).

After this code has run, the image is in ProgramData.ScannedImage and stays there (for displaying - zooming).

  if (ProgramData.ScannedImage != NULL) {
    delete ProgramData.ScannedImage;
  }

  ImgScanner->Image = "c:\\y.bmp";
  ImgScanner->FileType = 3;
  ImgScanner->CompressionType = 1;
  ImgScanner->StartScan();

  ProgramData.ScannedImage = new TPicture;
  ProgramData.ScannedImage->LoadFromFile("C:\\y.bmp");
  XMax = ProgramData.ScannedImage->Width;
  YMax = ProgramData.ScannedImage->Height;

Hope it works!
0
OdieCommented:
Sorry - thought I was in c++, for delphi this should be something like:

If (Programdata.ScannedImage <> nil) then begin
  ProgramData.ScannedImage.Free;
end;

ImgScanner.Image := 'C:\Y.Bmp';
ImgScanner.FileType := 3;
ImgScanner.CompressionType := 1;
ImgScanner.StartScan;

ProgramData.ScannedImage := TPicture.Create;
ProgramData.ScannedIMage.LoadFromFile('C:\Y.bmp');

0
MatveyAuthor Commented:
Odie, I was playing today for a very long time with this component but I couldn't get it save files as TIFF. Can you try to do this? because I have some really stupid problem...

Thanks!

Cheers,
Matvey

(POINTS=100)
0
OdieCommented:
Oh yes, but maybe it's my fault.  The FileType and CompressionType specify (and you must set it at runtime) what the file-format is.  You can see the numbers of this in the object-inspector.

I will also try this (I haven't tried it with tiff) - but maybe this may help you on your way faster.
0
MatveyAuthor Commented:
FileType for the ImgScan? -let's try...
0
MatveyAuthor Commented:
Odie, I tested the same procedure with VB and with Delphi (the saveas proc), and Delphi seems to have a problem!!! It doesn't saves the file!!! Did you try to save files of any type?

If you have an example that works please send it to me (email above), so I can see what  is really wrong here...

Big thanks!
0
OdieCommented:
OK I'll check (note: I tested it with C++Builder).
0
OdieCommented:
Sorry for the delay - but when I try it, it works.  Haven't you forgotten to set the component to save it as a file only?  (you can choose between display/file/both/...)  Haven't you forgotten setting the image property (maybe try it at runtime too - the component might 'forget')?
This is my working code:

  ImgScan1.Image := 'c:\xxx.tif';
  ImgScan1.FileType := 1;
  ImgScan1.CompressionType := 3;

  ImgScan1.StartScan;
0
MatveyAuthor Commented:
Hehe, I just found a very strange thing: it works well with D2, but not with D3!!!

So I move to D2...

BIG THANKS!
0
MatveyAuthor Commented:
Ooops! -the points!

Kind regards,
Matvey
0
OdieCommented:
Just to tell you it works on my Delphi 3.

Odie
0
MatveyAuthor Commented:
Odie, I think you can help me once again. Can I ask for your email please?
0
MatveyAuthor Commented:
Odie, I think you can help me once again. Can I ask for your email please?

bosism@netvision.net.il
0
OdieCommented:
smathsoft@geocities.com

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.