Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
Function resizeImage(ByVal imageName As String, ByVal newWidth As Integer, ByVal imageType As String, ByVal homeDirectory As String) As String Dim originalFileName As String Dim newFileName As String Dim tmpImage As Drawing.Bitmap Dim newImage As Drawing.Bitmap Dim g As Graphics Dim newHeight As Integer originalFileName = pickupFolder & imageName If File.Exists(originalFileName) = True Then Try tmpImage = New Bitmap(Bitmap.FromFile(originalFileName)) newHeight = (newWidth * tmpImage.Height) / tmpImage.Width newImage = New Bitmap(newWidth, newHeight) g = Graphics.FromImage(newImage) ' draw it with the new size g.DrawImage(tmpImage, 0, 0, newWidth, newHeight) newFileName = imageType & Replace(imageName, " ", "") newImage.Save("c:\inetpub\wwwroot\" & homeDirectory & "\photos\" & newFileName, Drawing.Imaging.ImageFormat.Jpeg) g.Dispose() newImage.Dispose() tmpImage.Dispose() tmpImage = Nothing newImage = Nothing g = Nothing resizeImage = newFileName Catch ex As Exception streamWriter.WriteLine(originalFileName & " gave error: " & ex.Message) Console.WriteLine(originalFileName & " gave error: " & ex.Message) End Try Else streamWriter.WriteLine(originalFileName & " does not exist") Console.WriteLine(originalFileName & " does not exist") End If tmpImage = Nothing newImage = Nothing g = Nothing End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|What are the best practices for using, and differences of, DataSet, DataView and DataTable?||3||31|
|Difficulty in writing procedure to determine which item of ToolStrip dropdown was clicked.||7||41|
|.NET Redemption/Outlook Examples||3||34|
|Whice version VisualStudio for new Dev Laptop?||10||43|
Join the community of 500,000 technology professionals and ask your questions.