there is a folder named "1"
"1" folder has around 1-100 image files in there
example file name: 000001.jpg 0000012.jpg 0000013.jpg ---> 000100.jpg
i want to combine all image from that folder (named 1)
and extract to one file (output_1.jpg) from 100 file to 1 file (Vertical)
but if there is 10 folder, combine all image from folder 1,2,3 .....
and extract to one file per folder
output_1.jpg (all image from folder 1)
output_2.jpg (all image from folder 2)
output_3.jpg (all image from folder 3)
and more
folder structure:
-----c:\
----------folder1\
---------------------000001.jpg
---------------------000002.jpg
the combined image file will be extract to c:\ (not in folder1 or 2 or 3 ....)
this is my code, i have to add more code file by file to combine them (headache attack)
Dim Img1 As Bitmap = Image.FromFile("C:\1\000001.jpg")
Dim Img2 As Bitmap = Image.FromFile("C:\1\000002.jpg")
Dim Img3 As Bitmap = Image.FromFile("C:\1\000003.jpg")
Dim Img4 As Bitmap = Image.FromFile("C:\1\000004.jpg")
Dim Img5 As Bitmap = Image.FromFile("C:\1\000005.jpg")
Dim extract_img As Bitmap
Dim Width As Integer
Dim Height As Integer
Dim x As Integer
Dim y As Integer
If Img1.Width > Img2.Width Then
Width = Img1.Width
Else
Width = Img2.Width
End If
Height = Img1.Height + Img2.Height + Img3.Height + Img4.Height + Img5.Height
extract_img = New Bitmap(Width, Height)
For x = 0 To Img1.Width - 1
For y = 0 To Img1.Height - 1
extract_img.SetPixel(x, y, Img1.GetPixel(x, y))
Next
Next
For x = 0 To Img2.Width - 1
For y = 0 To Img2.Height - 1
extract_img.SetPixel(x, y + Img1.Height, Img2.GetPixel(x, y))
Next
Next
For x = 0 To Img3.Width - 1
For y = 0 To Img3.Height - 1
extract_img.SetPixel(x, y + Img1.Height + Img2.Height, Img3.GetPixel(x, y))
Next
Next
For x = 0 To Img4.Width - 1
For y = 0 To Img4.Height - 1
extract_img.SetPixel(x, y + Img1.Height + Img2.Height + Img3.Height, Img4.GetPixel(x, y))
Next
Next
For x = 0 To Img5.Width - 1
For y = 0 To Img5.Height - 1
extract_img.SetPixel(x, y + Img1.Height + Img2.Height + Img3.Height + Img4.Height, Img5.GetPixel(x, y))
Next
Next
extract_img.Save("C:\output.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)