Search the web
Sign In
New User? Sign Up
AIL_Development · AIL Developer's Forum
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
TIF to BMP conversion   Message List  
Reply | Forward Message #122 of 125 |
Re: TIF to BMP conversion

I wrote the following code to go to the specified INPUT folder, search for all
.TIF files, load them 1 by 1, save them to the specified OUTPUT folder as BITMAP
(.BMP) images.

------------------------------

Const INPUT_EXTENSION As String = ".tif"
Const INPUT_PATH As String = "C:\"

Const OUTPUT_EXTENSION As String = ".bmp"
Const OUTPUT_PATH As String = "C:\!TEMP5\"

Dim objAIL As New cAdvancedImagery
Dim hIMG As Long
Dim arrFiles() As String
Dim lngTotal As Long
Dim lngCounter As Long
Dim strPath As String

strPath = Dir(INPUT_PATH & "*" & INPUT_EXTENSION, vbArchive Or vbHidden Or
vbNormal Or vbReadOnly Or vbSystem)
If strPath = "" Then
MsgBox "No image files found", vbOKOnly Or vbInformation, " "
Exit Sub
End If

Do While strPath <> ""
If strPath <> "." And strPath <> ".." Then
ReDim Preserve arrFiles(0 To lngTotal) As String
arrFiles(lngTotal) = strPath
lngTotal = lngTotal + 1
End If
strPath = Dir()
Loop

Set objAIL = New AdvImgLib.cAdvancedImagery

For lngCounter = 0 To (lngTotal - 1)
If objAIL.IO_LoadImage(INPUT_PATH & arrFiles(lngCounter), hIMG) = True Then
strPath = OUTPUT_PATH & Replace(arrFiles(lngCounter), INPUT_EXTENSION,
OUTPUT_EXTENSION, , , vbTextCompare)
If objAIL.IO_SaveImage(hIMG, strPath, IF_BMP, BMP_DEFAULT, True) = True
Then
Debug.Print "Successfully saved image: " & strPath
Else
MsgBox "Error saving image '" & strPath & "': " & objAIL.Error_GetLast
End If
Call objAIL.IO_DestroyImage(hIMG)
Else
MsgBox "Error loading image - " & objAIL.Error_GetLast
End If
Next

Set objAIL = Nothing





Fri Apr 17, 2009 2:49 am

kwilson1997
Offline Offline
Send Email Send Email

Forward
Message #122 of 125 |
Expand Messages Author Sort by Date

Can someone point me in the right direction? I am developmenting a batch process that needs to convert TIF images to BMP format for import into Navision,...
jennifercumpian
Offline Send Email
Apr 17, 2009
2:47 am

I wrote the following code to go to the specified INPUT folder, search for all .TIF files, load them 1 by 1, save them to the specified OUTPUT folder as BITMAP...
Kevin Wilson
kwilson1997
Offline Send Email
Apr 17, 2009
2:51 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help