Resizing Multiple Pictures?
Hello Forum!
It's been like 6 months since i've posted (since i quit CA for my new xbox) but its good to be back.
I was just wondering how I can change the resolution of multiple pictures using VB.
1) Explorer pops up to select photos
2) Form pops up to put in desired resolution
3) Form for desired output folder
I'm just not sure how to do much with file editing since much of my VB programming is Phishers (shame on me :/), autoclickers, and other random doo-dads not pertaining to file editing.
Much Appreciation,
John
[php] 'following code resizes picture to fit
Dim bm As New Bitmap(PictureBox1.Image)
Dim x As Int32 'variable for new width size
Dim y As Int32 'variable for new height size
Dim width As Integer = Val(x) 'image width.
Dim height As Integer = Val(y) 'image height
Dim thumb As New Bitmap(width, height)
Dim g As Graphics = Graphics.FromImage(thumb)
g****terpolationMode = Drawing2D****terpolationMode.HighQualityBicubic
g.DrawImage(bm, New Rectangle(0, 0, width, height), New Rectangle(0, 0, bm.Width, _
bm.Height), GraphicsUnit.Pixel)
g.Dispose()
'image path. better to make this dynamic. I am hardcoding a path just for example sake
thumb.Save("C:\newimage.bmp", _
System.Drawing.Imaging.ImageFormat.Bmp) 'can use any image format
bm.Dispose()
thumb.Dispose()
[/php]
Make a function out of it