Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

*.TIFF again

Posted on 1998-08-10
10
373 Views
Last Modified: 2013-11-19
I have to handle the bitmaps for thousands of *.TIFF file, which meant this must be done automatically by my VB codes. But VB does not support opening *.TIFF and I don't wanna mess up with decoding it myself.
How can I use any OCX that opens TIFF file and save it as other image file format automatically?
Or Can I use the imagebox/picturebox to somehow point at the image which be opened by the OCX application? So that I can make it appear on the imagebox/picturebox.
0
Comment
Question by:neural
10 Comments
 

Author Comment

by:neural
ID: 1468452
Edited text of question
0
 

Author Comment

by:neural
ID: 1468453
Edited text of question
0
 

Expert Comment

by:behrouz
ID: 1468454
neural,
Do you need to open the *.TIFF files for view-only or do you need to save or even manipulate them, as well?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 1

Accepted Solution

by:
soeding earned 60 total points
ID: 1468455
neural,

there are some image processing OCXs, as PhotoProGold (at http://www.pegasustools.com).

BUT you will have to license TIFF (as well as GIF) at UNISYS.
This is the main link for more information: http://www.unisys.com/LeadStory/lzwfaq.html.

If you write a request to Cheryl Tartler (Unisys, cheryldtartler@unn.unisys.com), you will get further information.

Regards
0
 
LVL 14

Expert Comment

by:waty
ID: 1468456
It was the quite the same question than the previous.

Here is a web site where you can find sources written in C
to read Tiff files :

http://nic.zcu.cz/ftp/pub/simtelnet/msdos/tiff
0
 
LVL 1

Expert Comment

by:soeding
ID: 1468457
neural, waty,

I was wrong: There are different file formats of TIFF (= different algorithms).
Only TIFF (LZW) has to be licensed:

From PhotoPro's Help:
>>>
TIF (Tag Image File Format)

Reads 1,  4, 8, 16, 24 and 32-bit uncompressed TIF.
Writes 1, 4, 8 and 24-bit uncompressed TIF.
Reads and writes CCITT RLE, Group 3, and Group 4 compressed TIF.
Reads and writes 1, 4, 8 and 24-bit Pack Bits TIF.
Reads and writes 1, 4, 8 and 24-bit LZW TIF ***1***
Reads 24-bit JPEG TIF.
Reads and writes 1, 4, 8 and 24-bit deflate TIF.
16 and 32-bit TIF files are converted to 24-bit.
Reads CMYK TIF.
Reads multiple page TIF.

1 LZW licensing required from Unisys for GIF and LZW TIF formats.
<<<

--------------------------------------------------------------------------------------
In http://nic.zcu.cz/ftp/pub/simtelnet/msdos/tiff/dtiff.zip an EXE is included, which opens a TIFF file in the DOS screen. If the DOS screen had a device context, one could copy the contents to a Windows picture, but I think it hasn't.
Another possibility would be to capture the screen, but there's the same problem with the device context, and you've got the wrong dimensions.

--------------------------------------------------------------------------------------
After downloading a little Scanner/Print program, I detected:
If you installed a TWAIN compatible scanner (and its software), you DID install some OCXs, which DO have the ability to read TIFF files and save it in TIFF or other formats.
So I hope, you have a scanner :-)
Of course you cannot redistribute the OCXs.

I may send you the VB app, I've downloaded.

--------------------------------------------------------------------------------------
If you do not want to distribute your app, you may try some batch converting software, i.e. Jasc Image Robot (Shareware).

--------------------------------------------------------------------------------------
Another, poor, possibility is to open a TIFF file in the default image processing program (with ShellExecute), and then SendKeys.
I did it with some 100s of pictures before some times.
0
 

Author Comment

by:neural
ID: 1468458
Seoding, thanks for replying my questions. I am trying to do that by the poor way-Sendkeys. And I am using the "Imaging" ocx to do that. But I will still have to do the "Open-->*.tif" and "save As *.bmp" by mouse clicking and there are thousands of *.Tiff files. Is there any way that I can specify the file name in the codes so that it will open and save from/into the filenames automatically? I believed that you didn't do that 100 files by mouse clicking.
0
 
LVL 1

Expert Comment

by:soeding
ID: 1468459
neural,
hi there,

if you want to read all files from one directory (did I understand?), here is the code:

Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As _
String, ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Dim x$
x = Dir(app.Path & "\" & "*.tif")
Do While x <> ""
  ShellExecute Me.Hwnd,"Open", x, "", app.Path, 1
  SendKeys "%f" & "a"
  ' % = ALT
  ' Try to simulate "File Save As"
  Sendkeys "{ENTER}"
 ' Do not forget to simulate "File close"
  DoEvents ' If there us any error, you can stop by "Ctrl+Alt+Del"
Loop

Good luck,
and if it does not work right now, post a comment again!
Any more questions? - You will reach your goal.
Thank you.
0
 

Author Comment

by:neural
ID: 1468460
Dear Soeding: I am trying to figure out your code, and running a couple of experiments on that. Thank you for all the mails you sent me for helping out.

0
 

Author Comment

by:neural
ID: 1468461
Dear Soeding, it worked. Thank you for everything.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question