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.
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 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 ("no property imgEdt1 found" etc.).
I hav echecked and rechecked everything. What am I missing?
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:
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.
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.
I did get the Scan Control to work, however there is a problem with using the "SetPageTypeCompressionOpts" 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 "MorgyDogy" (Don't ask why - please)
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.
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?
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.
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.
This contains information about how to use the DLL in VFP, plus a link for downloading it (that link is near the end of the article, if I remember right).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.