Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Tagged as

Resizing Batch Images

, 21 Feb 2008 CPOL
Resize all images in the source folder and save them in the destination folder
resizebatchimage.zip
resizeBatchImage
resizeBatchImage.suo
resizeBatchImage
bin
Release
My Project
Application.myapp
Settings.settings
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmMain
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.GroupBox4 = New System.Windows.Forms.GroupBox
        Me.chkEnableCrop = New System.Windows.Forms.CheckBox
        Me.Label17 = New System.Windows.Forms.Label
        Me.Label18 = New System.Windows.Forms.Label
        Me.Label19 = New System.Windows.Forms.Label
        Me.Label20 = New System.Windows.Forms.Label
        Me.FolderBrowserDialog1 = New System.Windows.Forms.FolderBrowserDialog
        Me.cmdBrowseImage = New System.Windows.Forms.Button
        Me.txtImageFolder = New System.Windows.Forms.TextBox
        Me.Label5 = New System.Windows.Forms.Label
        Me.cmdStart = New System.Windows.Forms.Button
        Me.cmdExit = New System.Windows.Forms.Button
        Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker
        Me.ProgressBar1 = New System.Windows.Forms.ProgressBar
        Me.cmdBrowseOutput = New System.Windows.Forms.Button
        Me.txtOutput = New System.Windows.Forms.TextBox
        Me.Label1 = New System.Windows.Forms.Label
        Me.lnkAbout = New System.Windows.Forms.LinkLabel
        Me.txtHeight = New System.Windows.Forms.NumericUpDown
        Me.txtWidth = New System.Windows.Forms.NumericUpDown
        Me.lblPleasewait = New System.Windows.Forms.Label
        Me.GroupBox4.SuspendLayout()
        CType(Me.txtHeight, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.txtWidth, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'GroupBox4
        '
        Me.GroupBox4.Controls.Add(Me.txtWidth)
        Me.GroupBox4.Controls.Add(Me.txtHeight)
        Me.GroupBox4.Controls.Add(Me.chkEnableCrop)
        Me.GroupBox4.Controls.Add(Me.Label17)
        Me.GroupBox4.Controls.Add(Me.Label18)
        Me.GroupBox4.Controls.Add(Me.Label19)
        Me.GroupBox4.Controls.Add(Me.Label20)
        Me.GroupBox4.Location = New System.Drawing.Point(12, 76)
        Me.GroupBox4.Name = "GroupBox4"
        Me.GroupBox4.Size = New System.Drawing.Size(477, 44)
        Me.GroupBox4.TabIndex = 75
        Me.GroupBox4.TabStop = False
        Me.GroupBox4.Text = "Mosaic image cell size"
        '
        'chkEnableCrop
        '
        Me.chkEnableCrop.AutoSize = True
        Me.chkEnableCrop.Checked = True
        Me.chkEnableCrop.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkEnableCrop.Location = New System.Drawing.Point(307, 19)
        Me.chkEnableCrop.Name = "chkEnableCrop"
        Me.chkEnableCrop.Size = New System.Drawing.Size(164, 17)
        Me.chkEnableCrop.TabIndex = 6
        Me.chkEnableCrop.Text = "Enable Croping Library Image"
        Me.chkEnableCrop.UseVisualStyleBackColor = True
        '
        'Label17
        '
        Me.Label17.AutoSize = True
        Me.Label17.Location = New System.Drawing.Point(260, 21)
        Me.Label17.Name = "Label17"
        Me.Label17.Size = New System.Drawing.Size(34, 13)
        Me.Label17.TabIndex = 3
        Me.Label17.Text = "Pixels"
        '
        'Label18
        '
        Me.Label18.AutoSize = True
        Me.Label18.Location = New System.Drawing.Point(111, 21)
        Me.Label18.Name = "Label18"
        Me.Label18.Size = New System.Drawing.Size(34, 13)
        Me.Label18.TabIndex = 2
        Me.Label18.Text = "Pixels"
        '
        'Label19
        '
        Me.Label19.AutoSize = True
        Me.Label19.Location = New System.Drawing.Point(155, 21)
        Me.Label19.Name = "Label19"
        Me.Label19.Size = New System.Drawing.Size(44, 13)
        Me.Label19.TabIndex = 1
        Me.Label19.Text = "Height :"
        '
        'Label20
        '
        Me.Label20.AutoSize = True
        Me.Label20.Location = New System.Drawing.Point(6, 21)
        Me.Label20.Name = "Label20"
        Me.Label20.Size = New System.Drawing.Size(41, 13)
        Me.Label20.TabIndex = 0
        Me.Label20.Text = "Width :"
        '
        'cmdBrowseImage
        '
        Me.cmdBrowseImage.Location = New System.Drawing.Point(464, 16)
        Me.cmdBrowseImage.Name = "cmdBrowseImage"
        Me.cmdBrowseImage.Size = New System.Drawing.Size(27, 25)
        Me.cmdBrowseImage.TabIndex = 1
        Me.cmdBrowseImage.Text = " ... "
        Me.cmdBrowseImage.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
        Me.cmdBrowseImage.UseVisualStyleBackColor = True
        '
        'txtImageFolder
        '
        Me.txtImageFolder.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtImageFolder.Location = New System.Drawing.Point(88, 17)
        Me.txtImageFolder.Name = "txtImageFolder"
        Me.txtImageFolder.Size = New System.Drawing.Size(370, 22)
        Me.txtImageFolder.TabIndex = 0
        '
        'Label5
        '
        Me.Label5.AutoSize = True
        Me.Label5.Location = New System.Drawing.Point(12, 22)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(76, 13)
        Me.Label5.TabIndex = 89
        Me.Label5.Text = "Images folder: "
        '
        'cmdStart
        '
        Me.cmdStart.Location = New System.Drawing.Point(12, 126)
        Me.cmdStart.Name = "cmdStart"
        Me.cmdStart.Size = New System.Drawing.Size(75, 23)
        Me.cmdStart.TabIndex = 7
        Me.cmdStart.Text = "Start"
        Me.cmdStart.UseVisualStyleBackColor = True
        '
        'cmdExit
        '
        Me.cmdExit.Location = New System.Drawing.Point(93, 126)
        Me.cmdExit.Name = "cmdExit"
        Me.cmdExit.Size = New System.Drawing.Size(75, 23)
        Me.cmdExit.TabIndex = 8
        Me.cmdExit.Text = "Exit"
        Me.cmdExit.UseVisualStyleBackColor = True
        '
        'BackgroundWorker1
        '
        Me.BackgroundWorker1.WorkerReportsProgress = True
        '
        'ProgressBar1
        '
        Me.ProgressBar1.Location = New System.Drawing.Point(174, 126)
        Me.ProgressBar1.Name = "ProgressBar1"
        Me.ProgressBar1.Size = New System.Drawing.Size(316, 23)
        Me.ProgressBar1.TabIndex = 9
        '
        'cmdBrowseOutput
        '
        Me.cmdBrowseOutput.Location = New System.Drawing.Point(464, 44)
        Me.cmdBrowseOutput.Name = "cmdBrowseOutput"
        Me.cmdBrowseOutput.Size = New System.Drawing.Size(27, 25)
        Me.cmdBrowseOutput.TabIndex = 3
        Me.cmdBrowseOutput.Text = " ... "
        Me.cmdBrowseOutput.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
        Me.cmdBrowseOutput.UseVisualStyleBackColor = True
        '
        'txtOutput
        '
        Me.txtOutput.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtOutput.Location = New System.Drawing.Point(88, 45)
        Me.txtOutput.Name = "txtOutput"
        Me.txtOutput.Size = New System.Drawing.Size(370, 22)
        Me.txtOutput.TabIndex = 2
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.Location = New System.Drawing.Point(12, 50)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(74, 13)
        Me.Label1.TabIndex = 95
        Me.Label1.Text = "Output folder: "
        '
        'lnkAbout
        '
        Me.lnkAbout.AutoSize = True
        Me.lnkAbout.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lnkAbout.Location = New System.Drawing.Point(15, 158)
        Me.lnkAbout.Name = "lnkAbout"
        Me.lnkAbout.Size = New System.Drawing.Size(369, 17)
        Me.lnkAbout.TabIndex = 10
        Me.lnkAbout.TabStop = True
        Me.lnkAbout.Text = "Programmer : Reza Shirazi Mofrad - www.rezashirazi.com"
        '
        'txtHeight
        '
        Me.txtHeight.Location = New System.Drawing.Point(205, 18)
        Me.txtHeight.Maximum = New Decimal(New Integer() {5000, 0, 0, 0})
        Me.txtHeight.Name = "txtHeight"
        Me.txtHeight.Size = New System.Drawing.Size(49, 20)
        Me.txtHeight.TabIndex = 5
        Me.txtHeight.Value = New Decimal(New Integer() {100, 0, 0, 0})
        '
        'txtWidth
        '
        Me.txtWidth.Location = New System.Drawing.Point(53, 18)
        Me.txtWidth.Maximum = New Decimal(New Integer() {5000, 0, 0, 0})
        Me.txtWidth.Name = "txtWidth"
        Me.txtWidth.Size = New System.Drawing.Size(49, 20)
        Me.txtWidth.TabIndex = 4
        Me.txtWidth.Value = New Decimal(New Integer() {100, 0, 0, 0})
        '
        'lblPleasewait
        '
        Me.lblPleasewait.AutoSize = True
        Me.lblPleasewait.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblPleasewait.ForeColor = System.Drawing.Color.Red
        Me.lblPleasewait.Location = New System.Drawing.Point(400, 159)
        Me.lblPleasewait.Name = "lblPleasewait"
        Me.lblPleasewait.Size = New System.Drawing.Size(91, 17)
        Me.lblPleasewait.TabIndex = 96
        Me.lblPleasewait.Text = "Please wait..."
        Me.lblPleasewait.Visible = False
        '
        'frmMain
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(497, 185)
        Me.Controls.Add(Me.lblPleasewait)
        Me.Controls.Add(Me.lnkAbout)
        Me.Controls.Add(Me.cmdBrowseOutput)
        Me.Controls.Add(Me.txtOutput)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.ProgressBar1)
        Me.Controls.Add(Me.cmdExit)
        Me.Controls.Add(Me.cmdStart)
        Me.Controls.Add(Me.cmdBrowseImage)
        Me.Controls.Add(Me.txtImageFolder)
        Me.Controls.Add(Me.Label5)
        Me.Controls.Add(Me.GroupBox4)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "frmMain"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Resize Batch Image 1.0"
        Me.GroupBox4.ResumeLayout(False)
        Me.GroupBox4.PerformLayout()
        CType(Me.txtHeight, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.txtWidth, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
    Friend WithEvents Label17 As System.Windows.Forms.Label
    Friend WithEvents Label18 As System.Windows.Forms.Label
    Friend WithEvents Label19 As System.Windows.Forms.Label
    Friend WithEvents Label20 As System.Windows.Forms.Label
    Friend WithEvents chkEnableCrop As System.Windows.Forms.CheckBox
    Friend WithEvents FolderBrowserDialog1 As System.Windows.Forms.FolderBrowserDialog
    Friend WithEvents cmdBrowseImage As System.Windows.Forms.Button
    Friend WithEvents txtImageFolder As System.Windows.Forms.TextBox
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents cmdStart As System.Windows.Forms.Button
    Friend WithEvents cmdExit As System.Windows.Forms.Button
    Friend WithEvents BackgroundWorker1 As System.ComponentModel.BackgroundWorker
    Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
    Friend WithEvents cmdBrowseOutput As System.Windows.Forms.Button
    Friend WithEvents txtOutput As System.Windows.Forms.TextBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents lnkAbout As System.Windows.Forms.LinkLabel
    Friend WithEvents txtWidth As System.Windows.Forms.NumericUpDown
    Friend WithEvents txtHeight As System.Windows.Forms.NumericUpDown
    Friend WithEvents lblPleasewait As System.Windows.Forms.Label

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

reza shirazi
Web Developer
Iran (Islamic Republic Of) Iran (Islamic Republic Of)
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150327.1 | Last Updated 21 Feb 2008
Article Copyright 2008 by reza shirazi
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid