To download this file, please login or click here to register

Thumbnails:

Description:
The core reducing functionality is inside the Reduce() subroutine, specifically in this line of code: img = New Bitmap(img, New Size(img.Size.Width * factor, img.Size.Height * factor)) The reducing factor is applied to both picture dimensions to preserve the aspect ratio; so, if the original picture's size is [x, y] and the reducing factor is F, the resulting image is sized [x*F, y*F] hence its area is reduced by F*F. It's easy to modify this formula to obtain different resizing behaviors. For example, if the set of the original pictures is not homogeneous in the sizes, you could want to reduce them not by a fixed factor, but to a specified size (regardless the original size). The Reduce() subroutine also contains some lines of code used to compute the file size of the resulting JPG picture. This computation is simply done looking at the size of a MemoryStream on which the image is saved in JPG format: Dim SizeKb As String Dim ms As New MemoryStream() img.Save(ms, Imaging.ImageFormat.Jpeg) SizeKb = (ms.Length \ 1024).ToString() & "Kb " A last thing to notice in the Image Batch Resizer utility is the persistence of the configuration settings between working sessions, accomplished by the use of the ConfigOpt class.
Submitted On:
31 Aug 2010
Submitted By:
Muhammad Farhan (solutionstand)
File Version:
1.0
File Size:
60.66 Kb
Downloads:
0
Support:
Click Here
Credits
1
Rating:
stars/0.gifTotal Votes:0

NRZEE BLOG

Blog

NRZEE Managing Director Neil Rabin rss

  • REGISTER HERE FOR FREE
  • REGISTER HERE FOR FREE