I'm trying to merge several tiff files into one multipage tiff. The code I've got is below. Every time it doesn't like the appendpage line. It keeps saying "expected =". Can anyone help? Thanks.
Dim mult As New FIMULTIBITMAP
Dim tiff As New FIBITMAP
Dim x As Integer
mult = FreeImage_OpenMultiBitmap(FIF_TIFF, File1.path & "\tmp.tif", True, False)
x = 0
While x < File1.ListCount
File1.Selected(x) = True
tiff = FreeImage_Load(FIF_TIFF, File1.path & "\" & File1.filename)
FreeImage_AppendPage(mult, FreeImage_lockpage(tiff,0))
FreeImage_Unload (tiff)
x = x + 1
Wend
FreeImage.FreeImage_CloseMultiBitmap (mult)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, I'd copied an experiment I tried. This is the code as it is now and it still doesn't work.
Dim mult As New FIMULTIBITMAP
Dim tiff As New FIBITMAP
Dim x As Integer
mult = FreeImage_OpenMultiBitmap(FIF_TIFF, File1.path & "\tmp.tif", True, False)
x = 0
While x < File1.ListCount
File1.Selected(x) = True
tiff = FreeImage_Load(FIF_TIFF, File1.path & "\" & File1.filename)
FreeImage_AppendPage(mult, tiff)
FreeImage_Unload (tiff)
x = x + 1
Wend
FreeImage.FreeImage_CloseMultiBitmap (mult)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to merge several tiff files into one multipage tiff. The code I've got is below. Every time it doesn't like the appendpage line. It keeps saying "expected =". Can anyone help? Thanks.
Dim mult As New FIMULTIBITMAP
Dim tiff As New FIBITMAP
Dim x As Integer
mult = FreeImage_OpenMultiBitmap(FIF_TIFF, File1.path & "\tmp.tif", True, False)
x = 0
While x < File1.ListCount
File1.Selected(x) = True
tiff = FreeImage_Load(FIF_TIFF, File1.path & "\" & File1.filename)
FreeImage_AppendPage(mult, FreeImage_lockpage(tiff,0))
FreeImage_Unload (tiff)
x = x + 1
Wend
FreeImage.FreeImage_CloseMultiBitmap (mult)
Use this :
FreeImage_AppendPage(mult, tiff)
You cannot call FreeImage_LockPage with a FIBITMAP (wrong argument)
Sorry, I'd copied an experiment I tried. This is the code as it is now and it still doesn't work.
Dim mult As New FIMULTIBITMAP
Dim tiff As New FIBITMAP
Dim x As Integer
mult = FreeImage_OpenMultiBitmap(FIF_TIFF, File1.path & "\tmp.tif", True, False)
x = 0
While x < File1.ListCount
File1.Selected(x) = True
tiff = FreeImage_Load(FIF_TIFF, File1.path & "\" & File1.filename)
FreeImage_AppendPage(mult, tiff)
FreeImage_Unload (tiff)
x = x + 1
Wend
FreeImage.FreeImage_CloseMultiBitmap (mult)