Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scanned Image

Status
Not open for further replies.

Z1

Programmer
May 8, 2000
14
0
0
US


How can I use "TIF image" on my forms? is it possible?

Thanks [sig][/sig]
 
Z1

You will need to use an ActiveX (OleControl) to display a .tif image on a form.

Another ActiveX control to try would be the Kodak Image Edit Control which might be on your system.

IMHO what would be simpler would be to use an FoxPro Image control. If you are scanning, as your thread title suggests, you would need to save the file to .jpeg or .jpg format instead, and then utilise the control.

Hope this helps.

Chris [sig][/sig]
 
Thanks Chris,

We are using VFP Image control by converting into GIF format but it consumed a lot of space. Our volume of scanned images are more than 5 Million and we want save space.

I will try with an ActiveX control. [sig][/sig]
 
Hi Z1,

Like Chris said, you can use the Kodak Image Edit Control or the Kodak Image Thumbnail Control.

Example:
ThisForm.oleImagen.Image = "MyFile.tif"
ThisForm.oleImagen.Display()

If the tif is multipage, you can display the next page by incrementing the page property:

ThisForm.oleImagen.Page = 2
ThisForm.oleImagen.Display()

I think you'll find these controls provide great functionality for managing images...I just wish they'd fix the f***ed up scroll bars. [sig]<p>Jon Hawkins<br><a href=mailto: jonscott8@yahoo.com> jonscott8@yahoo.com</a><br><a href= > </a><br>The World Is Headed For Mutiny.....When All We Want Is Unity. - Creed[/sig]
 
I have attempted to install the Kodak Image Control on Win XP and I have tried using it in VFP6 with no results.
I.E. I have not been able to view the picture (a tiff file) and the program does not recognize the OLE control name (&quot;no property imgEdt1 found&quot; etc.).

I hav echecked and rechecked everything. What am I missing?
 
Z1,

I've had mixed results with the Kodak control. The scanning generally works OK, but it has difficulty in saving the image. Some versions seem more reliable than others.

I switched to using a product called EZTWAIN, which is much easier, and is free. It handles the scanning fine. I then used the native VFP image control to display the image.

If you would like to see my code, or further information on how to do this, see:

Hope this helps.

Mike
Mike Lewis
Edinburgh, Scotland
 
MikeLewis,

Hi there! I've tried your code and it works just fine. I just would like to ask how can you save the image in JPG/JPEG format as the code you've presented is using the BMP format as default.

Thanks in advance.

(^_^)
The_ArchBishop
Manila, Philippines


 
Hi ArchBishop,

I just would like to ask how can you save the image in JPG/JPEG format

You need to call the TWAIN_SetSaveFormat function, passing 4 as a parameter (4 = JPEG, 2 = BMP). Then, when you call TWAIN_WriteNativeToFilename, it will save in the specified format.

I think you also need to install another DLL in order to support JPG. See the EZTWAIN Readme file for details. Also, there is a function called EZTWAIN_IsJPegAvailable, which might be useful.

The best documentation I have for EZTWAIN is the file EZTWAIN.BAS, which comes with the product. It lists all the functions, albeit in VB format.

Hope this helps.

Mike
Mike Lewis
Edinburgh, Scotland
 
Thanks Mike! Your post is a breath of fresh air!

I did get the Scan Control to work, however there is a problem with using the &quot;SetPageTypeCompressionOpts&quot; method.
My scanner (Visioneer 9000 USB) does not respond to this command and I confirmed this in the Kodak Image Control readme.
(BTW, I have used both an Epson Perfection 1200 and the above scanner I just recently purchased. All I can say is that the Epson Perfection beats anything that's out there - in terms of speed and quality and manuverability. I haven't tried the newer models, but I assume that they are just as fast.)

...So I will have to try the EZTWAIN thing-ama-jig.
My question gets a bit more detailed:
Can I control the following with EZTWAIN:
-B/W Image
-300 DPI
-Save as TIFF w/Group 4 (or similar) compression

Matt Morganstern
aka &quot;MorgyDogy&quot; (Don't ask why - please)
 
Hi Matt,

I haven't had any experience of any of those things. Howerver, the documentation does contain the following:

Can I control the following with EZTWAIN:
-B/W Image


According to the documentation, the TWAIN_AcquireNative function takes the following parameters:
&H1 1-bit per pixel, B&W
&H2 1,4, or 8-bit grayscale
&H4 24-bit RGB color
&H8 1,4, or 8-bit palette

-300 DPI

The DIB_SetResolution function lets you set the horizontal and vertical resolution. You can also set the colour depth.

-Save as TIFF w/Group 4 (or similar) compression.

Can't see any references to TIFF in the documentation. The only way of setting the compression is for JPGs.

Some of the above functions might be sensitive to specific scanning devices.

Sorry I can't be more specific. If you would like to check my article mentioned above, this contains a link to the EZTWAIN site.

Mike
Mike Lewis
Edinburgh, Scotland
 
Hi there MikeLewis,

Thanks and to you MorgyDogy for a wonderful follow-up question. Please accept my apology for the delayed response. Our image scanning system is now working fine.

Anywayz, just one more follow-up question, since MorgyDogy asked about controlling the image, is it possible also to bypass the showing/opening of the screen for the scanner, I mean can we just hide this as it works in the background?

Thanks in advance!

(^_^)
The_Archbishop
Manila, Philippines

 
Hi Archbishop,

is it possible also to bypass the showing/opening of the screen for the scanner, I mean can we just hide this as it works in the background?


I think that depends on the TWAIN device. The EZTWAIN DLL does nothing to display the image (nor does the Kodak scanning control). It is up to the individual driver to do that. You'll have to check the software that came with the scanner.

Mike
Mike Lewis
Edinburgh, Scotland
 
I think TheArchbishop meant to hide the Twain interface screen...

BTW,I am in contact with Spike at dosdi (EZTWAIN) and I hope to be able to test his 'beta' Group4 Twain implementation.

I will try yo keep you updated...

MD
 
MD,

I think TheArchbishop meant to hide the Twain interface screen...

I'm not sure what screen you are referring to, but as far I know EZTWAIN does not display anything. I think it must be the device that displays it.

and I hope to be able to test his 'beta' Group4 Twain implementation.

That is very interesting. Yes, do please keep us informed.

Mike
Mike Lewis
Edinburgh, Scotland
 
MorgyDogy,

I think TheArchbishop meant to hide the Twain interface screen...

I'm not refering to the Twain interface screen, I'm refering to the screen of the scanner device itself.

It's like this:

We're using a HP scanner, so when the Twain interface is executed it calls for the scanner to scan the image and the screen for the HP scanner pops-up so the user can set the scan properties for the image (100 DPI,grayscale, etc.), and now since you've asked Mike if you can control these properties, I was just wondering if there's also a way of not displaying/showing the screen for the scanner device itself.

Thanks in advance.

(^_^)
The_ArchBishop
Manila, Philippines

 
mike where can I find the eztwain dll you refer to
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top