I'm sorry I dont understand what I'm doing, that's why there are no comments in the code... but I managed to create a multi frame tiff file. I used some code from CodeProject.com
VB Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim img1, img2, tiffImg As Bitmap img1 = Image.FromFile("C:\colormatrix.jpg") img2 = Image.FromFile("C:\txtr.bmp") tiffImg = New Bitmap(img1) Dim encParams As New EncoderParameters(1) ' You could use your method of getting the codec from file instead of using this.. but I guess this is better since you dont need to have a file to get the codec Dim codecInfo As ImageCodecInfo = GetEncoderInfo("image/tiff") encParams.Param(0) = New EncoderParameter(Encoder.SaveFlag, CLng(EncoderValue.MultiFrame)) tiffImg.Save("C:\tiffFile.tiff", codecInfo, encParams) encParams.Param(0) = New EncoderParameter(Encoder.SaveFlag, CLng(EncoderValue.FrameDimensionPage)) tiffImg.SaveAdd(img2, encParams) img1.Dispose() img2.Dispose() End Sub Private Function GetEncoderInfo(ByVal mimeType As [String]) As ImageCodecInfo Dim i As Integer Dim encoders() As ImageCodecInfo encoders = ImageCodecInfo.GetImageEncoders() For i = 0 To (encoders.Length - 1) If (encoders(i).MimeType = mimeType) Then Return encoders(i) End If Next i End Function
change the filenames onlyHTH should be a good enough example
this was the codeproject page btw: http://www.codeproject.com/vb/net/fa...asp?print=true




HTH should be a good enough example
Reply With Quote