Last active
October 30, 2019 15:45
-
-
Save rafatux/61fd665fc455e54d69ae14f2cf6e1d58 to your computer and use it in GitHub Desktop.
Redimensiona un conjunto de jgp de una carpeta a otra a un tamaño especificado en vb.net
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports System | |
Imports System.Drawing | |
Module Program | |
Sub Main(args As String()) | |
Dim sourcePath As String = args(0) | |
Dim outputPath As String = args(1) | |
IO.Directory.CreateDirectory(outputPath) | |
Dim dir = New IO.DirectoryInfo(sourcePath) | |
Dim files As IO.FileInfo() = dir.GetFiles("*.jpg", IO.SearchOption.AllDirectories) | |
For Each fInfo In files | |
Console.WriteLine("Procesando archivo" & fInfo.FullName) | |
Using img As Bitmap = Image.FromFile(fInfo.FullName) | |
Using resizedImg As New Bitmap(img, args(2), args(3)) | |
resizedImg.Save(IO.Path.Combine(outputPath, fInfo.Name), | |
Imaging.ImageFormat.Jpeg) | |
End Using | |
End Using | |
Next | |
End Sub | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment