├── .gitattributes ├── .gitignore ├── README.md ├── ReSizer.sln ├── ReSizer ├── App.config ├── Logger.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── ReSizer.csproj ├── ReSizerTool.Designer.cs ├── ReSizerTool.cs ├── ReSizerTool.resx ├── SizeJsons │ ├── AndroidSizes.json │ ├── UwpSizes.json │ └── iOSizes.json ├── ToolHelpers │ ├── ConfigManager.cs │ ├── ImageExtensions.cs │ ├── ImageHelper.cs │ └── ImageProcessor.cs └── packages.config └── ReadyExecutables ├── Newtonsoft.Json.dll ├── Newtonsoft.Json.xml ├── ReSizer.exe ├── ReSizer.exe.config └── SizeJsons ├── AndroidSizes.json ├── UwpSizes.json └── iOSizes.json /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | [Xx]64/ 19 | [Xx]86/ 20 | [Bb]uild/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | 85 | # Visual Studio profiler 86 | *.psess 87 | *.vsp 88 | *.vspx 89 | *.sap 90 | 91 | # TFS 2012 Local Workspace 92 | $tf/ 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | *.DotSettings.user 101 | 102 | # JustCode is a .NET coding add-in 103 | .JustCode 104 | 105 | # TeamCity is a build add-in 106 | _TeamCity* 107 | 108 | # DotCover is a Code Coverage Tool 109 | *.dotCover 110 | 111 | # NCrunch 112 | _NCrunch_* 113 | .*crunch*.local.xml 114 | nCrunchTemp_* 115 | 116 | # MightyMoose 117 | *.mm.* 118 | AutoTest.Net/ 119 | 120 | # Web workbench (sass) 121 | .sass-cache/ 122 | 123 | # Installshield output folder 124 | [Ee]xpress/ 125 | 126 | # DocProject is a documentation generator add-in 127 | DocProject/buildhelp/ 128 | DocProject/Help/*.HxT 129 | DocProject/Help/*.HxC 130 | DocProject/Help/*.hhc 131 | DocProject/Help/*.hhk 132 | DocProject/Help/*.hhp 133 | DocProject/Help/Html2 134 | DocProject/Help/html 135 | 136 | # Click-Once directory 137 | publish/ 138 | 139 | # Publish Web Output 140 | *.[Pp]ublish.xml 141 | *.azurePubxml 142 | 143 | # TODO: Un-comment the next line if you do not want to checkin 144 | # your web deploy settings because they may include unencrypted 145 | # passwords 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # NuGet Packages 150 | *.nupkg 151 | # The packages folder can be ignored because of Package Restore 152 | **/packages/* 153 | # except build/, which is used as an MSBuild target. 154 | !**/packages/build/ 155 | # Uncomment if necessary however generally it will be regenerated when needed 156 | #!**/packages/repositories.config 157 | # NuGet v3's project.json files produces more ignoreable files 158 | *.nuget.props 159 | *.nuget.targets 160 | 161 | # Microsoft Azure Build Output 162 | csx/ 163 | *.build.csdef 164 | 165 | # Microsoft Azure Emulator 166 | ecf/ 167 | rcf/ 168 | 169 | # Windows Store app package directory 170 | AppPackages/ 171 | BundleArtifacts/ 172 | 173 | # Visual Studio cache files 174 | # files ending in .cache can be ignored 175 | *.[Cc]ache 176 | # but keep track of directories ending in .cache 177 | !*.[Cc]ache/ 178 | 179 | # Others 180 | ClientBin/ 181 | [Ss]tyle[Cc]op.* 182 | ~$* 183 | *~ 184 | *.dbmdl 185 | *.dbproj.schemaview 186 | *.pfx 187 | *.publishsettings 188 | node_modules/ 189 | orleans.codegen.cs 190 | 191 | # RIA/Silverlight projects 192 | Generated_Code/ 193 | 194 | # Backup & report files from converting an old project file 195 | # to a newer Visual Studio version. Backup files are not needed, 196 | # because we have git ;-) 197 | _UpgradeReport_Files/ 198 | Backup*/ 199 | UpgradeLog*.XML 200 | UpgradeLog*.htm 201 | 202 | # SQL Server files 203 | *.mdf 204 | *.ldf 205 | 206 | # Business Intelligence projects 207 | *.rdl.data 208 | *.bim.layout 209 | *.bim_*.settings 210 | 211 | # Microsoft Fakes 212 | FakesAssemblies/ 213 | 214 | # GhostDoc plugin setting file 215 | *.GhostDoc.xml 216 | 217 | # Node.js Tools for Visual Studio 218 | .ntvs_analysis.dat 219 | 220 | # Visual Studio 6 build log 221 | *.plg 222 | 223 | # Visual Studio 6 workspace options file 224 | *.opt 225 | 226 | # Visual Studio LightSwitch build output 227 | **/*.HTMLClient/GeneratedArtifacts 228 | **/*.DesktopClient/GeneratedArtifacts 229 | **/*.DesktopClient/ModelManifest.xml 230 | **/*.Server/GeneratedArtifacts 231 | **/*.Server/ModelManifest.xml 232 | _Pvt_Extensions 233 | 234 | # LightSwitch generated files 235 | GeneratedArtifacts/ 236 | ModelManifest.xml 237 | 238 | # Paket dependency manager 239 | .paket/paket.exe 240 | 241 | # FAKE - F# Make 242 | .fake/ 243 | /ReadyExecutables/1500x1500 244 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ReSizer 2 | A simple GUI based desktop tool for resizing images, It can be used for to resize the Logo/App Icon for various mobile versions or resize a generic image to a particular size without loosing the quality of the image 3 | This tool is inspired by [DownSize](https://github.com/ChaseFlorell/Downsize) infact I am using it's logging and image convertion code, So kind of a new updated version of DownSize. 4 | 5 | ###Contributing### 6 | 7 | Altough I have tried to make this tool simple and easy to use but it might be missing feature X, or platform Y. If you want something that it can't currently provide, I love pull requests. If it's a bigger change, you can also create new tool using this code like I did with this tool. 8 | 9 | ###License### 10 | 11 | [Microsoft Public License (Ms-PL)](http://www.microsoft.com/en-us/openness/licenses.aspx#MPL) 12 | -------------------------------------------------------------------------------- /ReSizer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReSizer", "ReSizer\ReSizer.csproj", "{B8782BDF-40AB-4964-935A-8A9C085529F0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {B8782BDF-40AB-4964-935A-8A9C085529F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {B8782BDF-40AB-4964-935A-8A9C085529F0}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {B8782BDF-40AB-4964-935A-8A9C085529F0}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {B8782BDF-40AB-4964-935A-8A9C085529F0}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /ReSizer/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ReSizer/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | namespace ReSizer 4 | { 5 | public static class Logger 6 | { 7 | private static bool blLogToFile; 8 | private static bool blVerbose; 9 | private static string strLogFilePath; 10 | private static bool blQuiet; 11 | 12 | public static void Init(string logDir, bool logToFile, bool verbose, bool quiet) 13 | { 14 | blLogToFile = logToFile; 15 | blVerbose = verbose; 16 | blQuiet = quiet; 17 | 18 | if (!logToFile) return; 19 | 20 | var timeStamp = DateTime.Now.ToString("yyMMdd"); 21 | if (!Directory.Exists(logDir)) 22 | { 23 | Directory.CreateDirectory(logDir); 24 | } 25 | strLogFilePath = string.Format("{0}\\Log-{1}.log", logDir, timeStamp); 26 | } 27 | 28 | public static void WriteLine(string message = "") 29 | { 30 | if (!blQuiet) 31 | { 32 | Console.WriteLine(message); 33 | } 34 | WriteLog(string.Format("NORMAL: \t{0}", message)); 35 | } 36 | 37 | public static void WriteError(string message = "") 38 | { 39 | Console.ForegroundColor = ConsoleColor.Red; 40 | if (!blQuiet) 41 | { 42 | Console.WriteLine(message); 43 | } 44 | Console.ResetColor(); 45 | WriteLog(string.Format("ERROR: \t{0}", message)); 46 | } 47 | 48 | public static void WriteVerbose(string message = "") 49 | { 50 | if (!blVerbose) return; 51 | Console.ForegroundColor = ConsoleColor.Yellow; 52 | if (!blQuiet) 53 | { 54 | Console.WriteLine(message); 55 | } 56 | Console.ResetColor(); 57 | WriteLog(string.Format("VERBOSE: \t{0}", message)); 58 | } 59 | 60 | public static void WriteLine(string messageFormat, params object[] arg) 61 | { 62 | var message = string.Format(messageFormat, arg); 63 | WriteLine(message); 64 | } 65 | 66 | public static void WriteError(string messageFormat, params object[] arg) 67 | { 68 | var message = string.Format(messageFormat, arg); 69 | WriteError(message); 70 | } 71 | 72 | 73 | public static void WriteVerbose(string messageFormat, params object[] arg) 74 | { 75 | var message = string.Format(messageFormat, arg); 76 | WriteVerbose(message); 77 | } 78 | 79 | private static void WriteLog(string message) 80 | { 81 | if (!blLogToFile || string.IsNullOrWhiteSpace(message) || message.Trim().ToLower() == "normal:") return; 82 | 83 | using (var file = File.Open(strLogFilePath, FileMode.Append)) 84 | using (var writer = new StreamWriter(file)) 85 | { 86 | writer.WriteLine("{0}\t{1}", DateTime.Now, message); 87 | } 88 | } 89 | 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /ReSizer/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | namespace ReSizer 4 | { 5 | static class Program 6 | { 7 | [STAThread] 8 | static void Main() 9 | { 10 | Application.EnableVisualStyles(); 11 | Application.SetCompatibleTextRenderingDefault(false); 12 | Application.Run(new ReSizerTool()); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ReSizer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ReSizer")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ReSizer")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b8782bdf-40ab-4964-935a-8a9c085529f0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ReSizer/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ReSizer.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ReSizer.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /ReSizer/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /ReSizer/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ReSizer.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ReSizer/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ReSizer/ReSizer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {B8782BDF-40AB-4964-935A-8A9C085529F0} 8 | WinExe 9 | Properties 10 | ReSizer 11 | ReSizer 12 | v4.5.2 13 | 512 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | Form 55 | 56 | 57 | ReSizerTool.cs 58 | 59 | 60 | 61 | 62 | 63 | ReSizerTool.cs 64 | 65 | 66 | ResXFileCodeGenerator 67 | Resources.Designer.cs 68 | Designer 69 | 70 | 71 | True 72 | Resources.resx 73 | 74 | 75 | 76 | SettingsSingleFileGenerator 77 | Settings.Designer.cs 78 | 79 | 80 | True 81 | Settings.settings 82 | True 83 | 84 | 85 | Always 86 | 87 | 88 | Always 89 | 90 | 91 | Always 92 | 93 | 94 | 95 | 96 | 97 | 98 | 105 | -------------------------------------------------------------------------------- /ReSizer/ReSizerTool.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ReSizer 2 | { 3 | partial class ReSizerTool 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 32 | this.btnResize = new System.Windows.Forms.Button(); 33 | this.chkUwp = new System.Windows.Forms.CheckBox(); 34 | this.chkAndroid = new System.Windows.Forms.CheckBox(); 35 | this.chkiOS = new System.Windows.Forms.CheckBox(); 36 | this.lblUWPValues = new System.Windows.Forms.Label(); 37 | this.lblUWPTitle = new System.Windows.Forms.Label(); 38 | this.lblAndroidValue = new System.Windows.Forms.Label(); 39 | this.lblAndroid = new System.Windows.Forms.Label(); 40 | this.lbliOSValue = new System.Windows.Forms.Label(); 41 | this.lbliOSTitle = new System.Windows.Forms.Label(); 42 | this.btnSelectImage = new System.Windows.Forms.Button(); 43 | this.lblBaseImagePath = new System.Windows.Forms.Label(); 44 | this.label1 = new System.Windows.Forms.Label(); 45 | this.grpiOS = new System.Windows.Forms.GroupBox(); 46 | this.chkLstiOS = new System.Windows.Forms.CheckedListBox(); 47 | this.chlLstAndroid = new System.Windows.Forms.CheckedListBox(); 48 | this.groupBox3 = new System.Windows.Forms.GroupBox(); 49 | this.chkLstUwp = new System.Windows.Forms.CheckedListBox(); 50 | this.groupBox4 = new System.Windows.Forms.GroupBox(); 51 | this.groupBox2 = new System.Windows.Forms.GroupBox(); 52 | this.lblNewImagePathValue = new System.Windows.Forms.Label(); 53 | this.lblNewImagePath = new System.Windows.Forms.Label(); 54 | this.txtCusomHeight = new System.Windows.Forms.TextBox(); 55 | this.txtCustomWidth = new System.Windows.Forms.TextBox(); 56 | this.label4 = new System.Windows.Forms.Label(); 57 | this.label3 = new System.Windows.Forms.Label(); 58 | this.lblCustomImgPath = new System.Windows.Forms.Label(); 59 | this.btnReSizeCustom = new System.Windows.Forms.Button(); 60 | this.btnSelectCustomImage = new System.Windows.Forms.Button(); 61 | this.groupBox1.SuspendLayout(); 62 | this.grpiOS.SuspendLayout(); 63 | this.groupBox3.SuspendLayout(); 64 | this.groupBox4.SuspendLayout(); 65 | this.groupBox2.SuspendLayout(); 66 | this.SuspendLayout(); 67 | // 68 | // groupBox1 69 | // 70 | this.groupBox1.Controls.Add(this.btnResize); 71 | this.groupBox1.Controls.Add(this.chkUwp); 72 | this.groupBox1.Controls.Add(this.chkAndroid); 73 | this.groupBox1.Controls.Add(this.chkiOS); 74 | this.groupBox1.Controls.Add(this.lblUWPValues); 75 | this.groupBox1.Controls.Add(this.lblUWPTitle); 76 | this.groupBox1.Controls.Add(this.lblAndroidValue); 77 | this.groupBox1.Controls.Add(this.lblAndroid); 78 | this.groupBox1.Controls.Add(this.lbliOSValue); 79 | this.groupBox1.Controls.Add(this.lbliOSTitle); 80 | this.groupBox1.Controls.Add(this.btnSelectImage); 81 | this.groupBox1.Controls.Add(this.lblBaseImagePath); 82 | this.groupBox1.Controls.Add(this.label1); 83 | this.groupBox1.Location = new System.Drawing.Point(26, 25); 84 | this.groupBox1.Margin = new System.Windows.Forms.Padding(6); 85 | this.groupBox1.Name = "groupBox1"; 86 | this.groupBox1.Padding = new System.Windows.Forms.Padding(6); 87 | this.groupBox1.Size = new System.Drawing.Size(748, 337); 88 | this.groupBox1.TabIndex = 0; 89 | this.groupBox1.TabStop = false; 90 | // 91 | // btnResize 92 | // 93 | this.btnResize.Location = new System.Drawing.Point(520, 29); 94 | this.btnResize.Margin = new System.Windows.Forms.Padding(6); 95 | this.btnResize.Name = "btnResize"; 96 | this.btnResize.Size = new System.Drawing.Size(208, 44); 97 | this.btnResize.TabIndex = 12; 98 | this.btnResize.Text = "Re-Size"; 99 | this.btnResize.UseVisualStyleBackColor = true; 100 | this.btnResize.Click += new System.EventHandler(this.btnResize_Click); 101 | // 102 | // chkUwp 103 | // 104 | this.chkUwp.AutoSize = true; 105 | this.chkUwp.Location = new System.Drawing.Point(538, 137); 106 | this.chkUwp.Margin = new System.Windows.Forms.Padding(6); 107 | this.chkUwp.Name = "chkUwp"; 108 | this.chkUwp.Size = new System.Drawing.Size(93, 29); 109 | this.chkUwp.TabIndex = 11; 110 | this.chkUwp.Text = "UWP"; 111 | this.chkUwp.UseVisualStyleBackColor = true; 112 | // 113 | // chkAndroid 114 | // 115 | this.chkAndroid.AutoSize = true; 116 | this.chkAndroid.Location = new System.Drawing.Point(402, 137); 117 | this.chkAndroid.Margin = new System.Windows.Forms.Padding(6); 118 | this.chkAndroid.Name = "chkAndroid"; 119 | this.chkAndroid.Size = new System.Drawing.Size(118, 29); 120 | this.chkAndroid.TabIndex = 10; 121 | this.chkAndroid.Text = "Android"; 122 | this.chkAndroid.UseVisualStyleBackColor = true; 123 | // 124 | // chkiOS 125 | // 126 | this.chkiOS.AutoSize = true; 127 | this.chkiOS.Location = new System.Drawing.Point(304, 137); 128 | this.chkiOS.Margin = new System.Windows.Forms.Padding(6); 129 | this.chkiOS.Name = "chkiOS"; 130 | this.chkiOS.Size = new System.Drawing.Size(79, 29); 131 | this.chkiOS.TabIndex = 9; 132 | this.chkiOS.Text = "iOS"; 133 | this.chkiOS.UseVisualStyleBackColor = true; 134 | // 135 | // lblUWPValues 136 | // 137 | this.lblUWPValues.AutoSize = true; 138 | this.lblUWPValues.Location = new System.Drawing.Point(298, 283); 139 | this.lblUWPValues.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 140 | this.lblUWPValues.Name = "lblUWPValues"; 141 | this.lblUWPValues.Size = new System.Drawing.Size(236, 25); 142 | this.lblUWPValues.TabIndex = 8; 143 | this.lblUWPValues.Text = "Base Image Path Value"; 144 | this.lblUWPValues.Visible = false; 145 | // 146 | // lblUWPTitle 147 | // 148 | this.lblUWPTitle.AutoSize = true; 149 | this.lblUWPTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 150 | this.lblUWPTitle.Location = new System.Drawing.Point(18, 283); 151 | this.lblUWPTitle.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 152 | this.lblUWPTitle.Name = "lblUWPTitle"; 153 | this.lblUWPTitle.Size = new System.Drawing.Size(229, 26); 154 | this.lblUWPTitle.TabIndex = 7; 155 | this.lblUWPTitle.Text = "UWP Images Path : "; 156 | this.lblUWPTitle.Visible = false; 157 | // 158 | // lblAndroidValue 159 | // 160 | this.lblAndroidValue.AutoSize = true; 161 | this.lblAndroidValue.Location = new System.Drawing.Point(298, 238); 162 | this.lblAndroidValue.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 163 | this.lblAndroidValue.Name = "lblAndroidValue"; 164 | this.lblAndroidValue.Size = new System.Drawing.Size(236, 25); 165 | this.lblAndroidValue.TabIndex = 6; 166 | this.lblAndroidValue.Text = "Base Image Path Value"; 167 | this.lblAndroidValue.Visible = false; 168 | // 169 | // lblAndroid 170 | // 171 | this.lblAndroid.AutoSize = true; 172 | this.lblAndroid.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 173 | this.lblAndroid.Location = new System.Drawing.Point(18, 238); 174 | this.lblAndroid.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 175 | this.lblAndroid.Name = "lblAndroid"; 176 | this.lblAndroid.Size = new System.Drawing.Size(256, 26); 177 | this.lblAndroid.TabIndex = 5; 178 | this.lblAndroid.Text = "Android Images Path : "; 179 | this.lblAndroid.Visible = false; 180 | // 181 | // lbliOSValue 182 | // 183 | this.lbliOSValue.AutoSize = true; 184 | this.lbliOSValue.Location = new System.Drawing.Point(298, 194); 185 | this.lbliOSValue.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 186 | this.lbliOSValue.Name = "lbliOSValue"; 187 | this.lbliOSValue.Size = new System.Drawing.Size(236, 25); 188 | this.lbliOSValue.TabIndex = 4; 189 | this.lbliOSValue.Text = "Base Image Path Value"; 190 | this.lbliOSValue.Visible = false; 191 | // 192 | // lbliOSTitle 193 | // 194 | this.lbliOSTitle.AutoSize = true; 195 | this.lbliOSTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 196 | this.lbliOSTitle.Location = new System.Drawing.Point(18, 194); 197 | this.lbliOSTitle.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 198 | this.lbliOSTitle.Name = "lbliOSTitle"; 199 | this.lbliOSTitle.Size = new System.Drawing.Size(214, 26); 200 | this.lbliOSTitle.TabIndex = 3; 201 | this.lbliOSTitle.Text = "iOS Images Path : "; 202 | this.lbliOSTitle.Visible = false; 203 | // 204 | // btnSelectImage 205 | // 206 | this.btnSelectImage.Location = new System.Drawing.Point(300, 29); 207 | this.btnSelectImage.Margin = new System.Windows.Forms.Padding(6); 208 | this.btnSelectImage.Name = "btnSelectImage"; 209 | this.btnSelectImage.Size = new System.Drawing.Size(208, 44); 210 | this.btnSelectImage.TabIndex = 2; 211 | this.btnSelectImage.Text = "Select Base Image"; 212 | this.btnSelectImage.UseVisualStyleBackColor = true; 213 | this.btnSelectImage.Click += new System.EventHandler(this.btnSelectImage_Click); 214 | // 215 | // lblBaseImagePath 216 | // 217 | this.lblBaseImagePath.AutoSize = true; 218 | this.lblBaseImagePath.Location = new System.Drawing.Point(298, 88); 219 | this.lblBaseImagePath.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 220 | this.lblBaseImagePath.Name = "lblBaseImagePath"; 221 | this.lblBaseImagePath.Size = new System.Drawing.Size(0, 25); 222 | this.lblBaseImagePath.TabIndex = 1; 223 | // 224 | // label1 225 | // 226 | this.label1.AutoSize = true; 227 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 228 | this.label1.Location = new System.Drawing.Point(14, 38); 229 | this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 230 | this.label1.Name = "label1"; 231 | this.label1.Size = new System.Drawing.Size(160, 26); 232 | this.label1.TabIndex = 0; 233 | this.label1.Text = "Base Image : "; 234 | // 235 | // grpiOS 236 | // 237 | this.grpiOS.Controls.Add(this.chkLstiOS); 238 | this.grpiOS.Location = new System.Drawing.Point(26, 371); 239 | this.grpiOS.Name = "grpiOS"; 240 | this.grpiOS.Size = new System.Drawing.Size(438, 550); 241 | this.grpiOS.TabIndex = 1; 242 | this.grpiOS.TabStop = false; 243 | this.grpiOS.Text = "iOS Image Sizes"; 244 | // 245 | // chkLstiOS 246 | // 247 | this.chkLstiOS.FormattingEnabled = true; 248 | this.chkLstiOS.Location = new System.Drawing.Point(21, 29); 249 | this.chkLstiOS.Name = "chkLstiOS"; 250 | this.chkLstiOS.Size = new System.Drawing.Size(394, 498); 251 | this.chkLstiOS.TabIndex = 0; 252 | // 253 | // chlLstAndroid 254 | // 255 | this.chlLstAndroid.FormattingEnabled = true; 256 | this.chlLstAndroid.Location = new System.Drawing.Point(20, 30); 257 | this.chlLstAndroid.Name = "chlLstAndroid"; 258 | this.chlLstAndroid.Size = new System.Drawing.Size(394, 498); 259 | this.chlLstAndroid.TabIndex = 0; 260 | // 261 | // groupBox3 262 | // 263 | this.groupBox3.Controls.Add(this.chlLstAndroid); 264 | this.groupBox3.Location = new System.Drawing.Point(482, 371); 265 | this.groupBox3.Name = "groupBox3"; 266 | this.groupBox3.Size = new System.Drawing.Size(438, 550); 267 | this.groupBox3.TabIndex = 2; 268 | this.groupBox3.TabStop = false; 269 | this.groupBox3.Text = "Android Image Sizes"; 270 | // 271 | // chkLstUwp 272 | // 273 | this.chkLstUwp.FormattingEnabled = true; 274 | this.chkLstUwp.Location = new System.Drawing.Point(21, 29); 275 | this.chkLstUwp.Name = "chkLstUwp"; 276 | this.chkLstUwp.Size = new System.Drawing.Size(394, 498); 277 | this.chkLstUwp.TabIndex = 0; 278 | // 279 | // groupBox4 280 | // 281 | this.groupBox4.Controls.Add(this.chkLstUwp); 282 | this.groupBox4.Location = new System.Drawing.Point(942, 371); 283 | this.groupBox4.Name = "groupBox4"; 284 | this.groupBox4.Size = new System.Drawing.Size(438, 550); 285 | this.groupBox4.TabIndex = 3; 286 | this.groupBox4.TabStop = false; 287 | this.groupBox4.Text = "UWP Image Sizes"; 288 | // 289 | // groupBox2 290 | // 291 | this.groupBox2.Controls.Add(this.lblNewImagePathValue); 292 | this.groupBox2.Controls.Add(this.lblNewImagePath); 293 | this.groupBox2.Controls.Add(this.txtCusomHeight); 294 | this.groupBox2.Controls.Add(this.txtCustomWidth); 295 | this.groupBox2.Controls.Add(this.label4); 296 | this.groupBox2.Controls.Add(this.label3); 297 | this.groupBox2.Controls.Add(this.lblCustomImgPath); 298 | this.groupBox2.Controls.Add(this.btnReSizeCustom); 299 | this.groupBox2.Controls.Add(this.btnSelectCustomImage); 300 | this.groupBox2.Location = new System.Drawing.Point(783, 38); 301 | this.groupBox2.Name = "groupBox2"; 302 | this.groupBox2.Size = new System.Drawing.Size(597, 324); 303 | this.groupBox2.TabIndex = 4; 304 | this.groupBox2.TabStop = false; 305 | this.groupBox2.Text = "Create Custom Size Icon"; 306 | // 307 | // lblNewImagePathValue 308 | // 309 | this.lblNewImagePathValue.AutoSize = true; 310 | this.lblNewImagePathValue.Location = new System.Drawing.Point(222, 200); 311 | this.lblNewImagePathValue.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 312 | this.lblNewImagePathValue.Name = "lblNewImagePathValue"; 313 | this.lblNewImagePathValue.Size = new System.Drawing.Size(236, 25); 314 | this.lblNewImagePathValue.TabIndex = 20; 315 | this.lblNewImagePathValue.Text = "Base Image Path Value"; 316 | this.lblNewImagePathValue.Visible = false; 317 | // 318 | // lblNewImagePath 319 | // 320 | this.lblNewImagePath.AutoSize = true; 321 | this.lblNewImagePath.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 322 | this.lblNewImagePath.Location = new System.Drawing.Point(12, 200); 323 | this.lblNewImagePath.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 324 | this.lblNewImagePath.Name = "lblNewImagePath"; 325 | this.lblNewImagePath.Size = new System.Drawing.Size(209, 26); 326 | this.lblNewImagePath.TabIndex = 13; 327 | this.lblNewImagePath.Text = "New Image Path : "; 328 | this.lblNewImagePath.Visible = false; 329 | // 330 | // txtCusomHeight 331 | // 332 | this.txtCusomHeight.Location = new System.Drawing.Point(452, 141); 333 | this.txtCusomHeight.Name = "txtCusomHeight"; 334 | this.txtCusomHeight.Size = new System.Drawing.Size(122, 31); 335 | this.txtCusomHeight.TabIndex = 18; 336 | // 337 | // txtCustomWidth 338 | // 339 | this.txtCustomWidth.Location = new System.Drawing.Point(159, 141); 340 | this.txtCustomWidth.Name = "txtCustomWidth"; 341 | this.txtCustomWidth.Size = new System.Drawing.Size(134, 31); 342 | this.txtCustomWidth.TabIndex = 17; 343 | // 344 | // label4 345 | // 346 | this.label4.AutoSize = true; 347 | this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 348 | this.label4.Location = new System.Drawing.Point(302, 141); 349 | this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 350 | this.label4.Name = "label4"; 351 | this.label4.Size = new System.Drawing.Size(156, 26); 352 | this.label4.TabIndex = 16; 353 | this.label4.Text = "New Height : "; 354 | // 355 | // label3 356 | // 357 | this.label3.AutoSize = true; 358 | this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 359 | this.label3.Location = new System.Drawing.Point(12, 143); 360 | this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 361 | this.label3.Name = "label3"; 362 | this.label3.Size = new System.Drawing.Size(148, 26); 363 | this.label3.TabIndex = 13; 364 | this.label3.Text = "New Width : "; 365 | // 366 | // lblCustomImgPath 367 | // 368 | this.lblCustomImgPath.AutoSize = true; 369 | this.lblCustomImgPath.Location = new System.Drawing.Point(12, 92); 370 | this.lblCustomImgPath.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); 371 | this.lblCustomImgPath.Name = "lblCustomImgPath"; 372 | this.lblCustomImgPath.Size = new System.Drawing.Size(0, 25); 373 | this.lblCustomImgPath.TabIndex = 15; 374 | // 375 | // btnReSizeCustom 376 | // 377 | this.btnReSizeCustom.Location = new System.Drawing.Point(17, 261); 378 | this.btnReSizeCustom.Margin = new System.Windows.Forms.Padding(6); 379 | this.btnReSizeCustom.Name = "btnReSizeCustom"; 380 | this.btnReSizeCustom.Size = new System.Drawing.Size(557, 44); 381 | this.btnReSizeCustom.TabIndex = 14; 382 | this.btnReSizeCustom.Text = "Create Custom Size Icon"; 383 | this.btnReSizeCustom.UseVisualStyleBackColor = true; 384 | this.btnReSizeCustom.Click += new System.EventHandler(this.btnReSizeCustom_Click); 385 | // 386 | // btnSelectCustomImage 387 | // 388 | this.btnSelectCustomImage.Location = new System.Drawing.Point(17, 33); 389 | this.btnSelectCustomImage.Margin = new System.Windows.Forms.Padding(6); 390 | this.btnSelectCustomImage.Name = "btnSelectCustomImage"; 391 | this.btnSelectCustomImage.Size = new System.Drawing.Size(557, 44); 392 | this.btnSelectCustomImage.TabIndex = 13; 393 | this.btnSelectCustomImage.Text = "Select Base Image for Custom ReSize"; 394 | this.btnSelectCustomImage.UseVisualStyleBackColor = true; 395 | this.btnSelectCustomImage.Click += new System.EventHandler(this.btnSelectCustomImage_Click); 396 | // 397 | // ReSizerTool 398 | // 399 | this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); 400 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 401 | this.ClientSize = new System.Drawing.Size(1400, 933); 402 | this.Controls.Add(this.groupBox2); 403 | this.Controls.Add(this.groupBox4); 404 | this.Controls.Add(this.groupBox3); 405 | this.Controls.Add(this.grpiOS); 406 | this.Controls.Add(this.groupBox1); 407 | this.Margin = new System.Windows.Forms.Padding(6); 408 | this.MaximizeBox = false; 409 | this.Name = "ReSizerTool"; 410 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 411 | this.Text = "App Image ReSizer"; 412 | this.Load += new System.EventHandler(this.ReSizerTool_Load); 413 | this.groupBox1.ResumeLayout(false); 414 | this.groupBox1.PerformLayout(); 415 | this.grpiOS.ResumeLayout(false); 416 | this.groupBox3.ResumeLayout(false); 417 | this.groupBox4.ResumeLayout(false); 418 | this.groupBox2.ResumeLayout(false); 419 | this.groupBox2.PerformLayout(); 420 | this.ResumeLayout(false); 421 | 422 | } 423 | 424 | #endregion 425 | 426 | private System.Windows.Forms.GroupBox groupBox1; 427 | private System.Windows.Forms.Button btnSelectImage; 428 | private System.Windows.Forms.Label lblBaseImagePath; 429 | private System.Windows.Forms.Label label1; 430 | private System.Windows.Forms.CheckBox chkUwp; 431 | private System.Windows.Forms.CheckBox chkAndroid; 432 | private System.Windows.Forms.CheckBox chkiOS; 433 | private System.Windows.Forms.Label lblUWPValues; 434 | private System.Windows.Forms.Label lblUWPTitle; 435 | private System.Windows.Forms.Label lblAndroidValue; 436 | private System.Windows.Forms.Label lblAndroid; 437 | private System.Windows.Forms.Label lbliOSValue; 438 | private System.Windows.Forms.Label lbliOSTitle; 439 | private System.Windows.Forms.Button btnResize; 440 | private System.Windows.Forms.GroupBox grpiOS; 441 | private System.Windows.Forms.CheckedListBox chkLstiOS; 442 | private System.Windows.Forms.CheckedListBox chlLstAndroid; 443 | private System.Windows.Forms.GroupBox groupBox3; 444 | private System.Windows.Forms.CheckedListBox chkLstUwp; 445 | private System.Windows.Forms.GroupBox groupBox4; 446 | private System.Windows.Forms.GroupBox groupBox2; 447 | private System.Windows.Forms.Button btnReSizeCustom; 448 | private System.Windows.Forms.Button btnSelectCustomImage; 449 | private System.Windows.Forms.Label lblNewImagePathValue; 450 | private System.Windows.Forms.Label lblNewImagePath; 451 | private System.Windows.Forms.TextBox txtCusomHeight; 452 | private System.Windows.Forms.TextBox txtCustomWidth; 453 | private System.Windows.Forms.Label label4; 454 | private System.Windows.Forms.Label label3; 455 | private System.Windows.Forms.Label lblCustomImgPath; 456 | } 457 | } 458 | 459 | -------------------------------------------------------------------------------- /ReSizer/ReSizerTool.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Drawing; 5 | using System.Drawing.Drawing2D; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Windows.Forms; 9 | using System.Xml.Serialization; 10 | 11 | namespace ReSizer 12 | { 13 | public partial class ReSizerTool : Form 14 | { 15 | public ReSizerTool() 16 | { 17 | InitializeComponent(); 18 | } 19 | private void ReSizerTool_Load(object sender, EventArgs e) 20 | { 21 | var vOutPath = AppDomain.CurrentDomain.BaseDirectory; 22 | var viOSizesFile = vOutPath + @"\SizeJsons\iOSizes.json"; 23 | var vLoadedFileJson = File.ReadAllText(viOSizesFile); 24 | var viOsSizes = JsonConvert.DeserializeObject>(vLoadedFileJson); 25 | foreach (var vSingleSize in viOsSizes) 26 | { chkLstiOS.Items.Add(vSingleSize.ImageName);} 27 | var vDroidSizesFile = vOutPath + @"\SizeJsons\AndroidSizes.json"; 28 | var vDroidSizeJson = File.ReadAllText(vDroidSizesFile); 29 | var vDroidSizes = JsonConvert.DeserializeObject>(vDroidSizeJson); 30 | foreach (var vSingleSize in vDroidSizes) 31 | { chlLstAndroid.Items.Add(vSingleSize.ImageName); } 32 | var vUwpSizesFile = vOutPath + @"\SizeJsons\UwpSizes.json"; 33 | var vUwpSizeJson = File.ReadAllText(vUwpSizesFile); 34 | var vUwpSizes = JsonConvert.DeserializeObject>(vUwpSizeJson); 35 | foreach (var vSingleSize in vUwpSizes) 36 | { chkLstUwp.Items.Add(vSingleSize.ImageName); } 37 | } 38 | private void btnReSizeCustom_Click(object sender, EventArgs e) 39 | { 40 | if (string.IsNullOrEmpty(lblCustomImgPath.Text.Trim())) 41 | { MessageBox.Show("Please Select the Base Image it's Mandatory"); } 42 | else if(string.IsNullOrEmpty(txtCustomWidth.Text.Trim())) 43 | { 44 | MessageBox.Show("Please Enter Width it's Mandatory"); 45 | } 46 | else if (string.IsNullOrEmpty(txtCusomHeight.Text.Trim())) 47 | { 48 | MessageBox.Show("Please Enter Height it's Mandatory"); 49 | } 50 | 51 | var sBaseImagePath = lblCustomImgPath.Text.Trim(); 52 | var vOutPath = AppDomain.CurrentDomain.BaseDirectory; 53 | var vFileName = Path.GetFileNameWithoutExtension(sBaseImagePath); 54 | var vImageOutPath = vOutPath + @"\" + vFileName; 55 | var vNewWidth = Convert.ToInt16(txtCustomWidth.Text.Trim()); 56 | var vNewHeight = Convert.ToInt16(txtCusomHeight.Text.Trim()); 57 | var vNewImageName = vOutPath + "\\" + vFileName + "CustomReSize.png"; 58 | var vNewIMage = Scale(vNewWidth, vNewHeight, sBaseImagePath); 59 | vNewIMage.Save(vNewImageName); 60 | lblNewImagePath.Visible = true; 61 | lblNewImagePathValue.Text = vNewImageName; 62 | lblNewImagePathValue.Visible = true; 63 | MessageBox.Show("Custom Re-Sized Image Created"); 64 | } 65 | 66 | private void btnSelectCustomImage_Click(object sender, EventArgs e) 67 | { 68 | var vFileOpener = new OpenFileDialog(); 69 | vFileOpener.ShowDialog(); 70 | lblCustomImgPath.Text = vFileOpener.FileName; 71 | 72 | } 73 | private void btnSelectImage_Click(object sender, EventArgs e) 74 | { 75 | var vFileOpener = new OpenFileDialog(); 76 | vFileOpener.ShowDialog(); 77 | lblBaseImagePath.Text = vFileOpener.FileName; 78 | } 79 | private void TestImageCreation(string sBaseImagePath) { 80 | var vOutPath = AppDomain.CurrentDomain.BaseDirectory; 81 | var log = false; var verbose = false; var quiet = false; 82 | Logger.Init(vOutPath, log, verbose, quiet); 83 | Logger.WriteLine("Begin Resizing Images!"); 84 | Logger.WriteVerbose("Writing files to {0}", vOutPath); 85 | var viOSOutputPath = vOutPath + "\\iOSImages"; 86 | Directory.CreateDirectory(viOSOutputPath); 87 | Logger.WriteVerbose("Created directory {0} for iOS Images", viOSOutputPath); 88 | var vImageName = "58X58"; 89 | var vWidth = 58;var vHeight=58; 90 | var vNewImageName = viOSOutputPath + "\\" + vImageName + ".png"; 91 | var vNewIMage = Scale(vWidth, vHeight, sBaseImagePath); 92 | vNewIMage.Save(vNewImageName); 93 | MessageBox.Show("Image Created"); 94 | } 95 | 96 | private void CreateImages(string sBaseImagePath) 97 | { 98 | var vOutPath = AppDomain.CurrentDomain.BaseDirectory; 99 | var vFileName = Path.GetFileNameWithoutExtension(sBaseImagePath); 100 | var vImageOutPath = vOutPath + @"\" + vFileName; 101 | Directory.CreateDirectory(vOutPath); 102 | var log = false; var verbose = false; var quiet = false; 103 | Logger.Init(vOutPath, log, verbose, quiet); 104 | Logger.WriteLine("Begin Resizing Images!"); 105 | Logger.WriteVerbose("Writing files to {0}", vOutPath); 106 | if (chkiOS.Checked) 107 | { 108 | var viOSOutputPath = vImageOutPath + @"\iOSImages"; 109 | Directory.CreateDirectory(viOSOutputPath); 110 | Logger.WriteVerbose("Created directory {0} for iOS Images", viOSOutputPath); 111 | 112 | var viOSizesFile = vOutPath + @"\SizeJsons\iOSizes.json"; 113 | var vLoadedFileJson = File.ReadAllText(viOSizesFile); 114 | var viOsSizes = JsonConvert.DeserializeObject>(vLoadedFileJson); 115 | for (int iCount = 0; iCount < chkLstiOS.CheckedItems.Count; iCount++) 116 | { 117 | var vSelSize = chkLstiOS.CheckedItems[iCount].ToString(); 118 | var vSelectedImage = (from SelImage in viOsSizes where SelImage.ImageName == vSelSize 119 | select SelImage).SingleOrDefault(); 120 | Logger.WriteVerbose("Creating Image for {0} of iOS Images", vSelSize); 121 | var vNewImageName = viOSOutputPath + "\\" + vSelSize + ".png"; 122 | var vNewIMage = Scale(vSelectedImage.Width, vSelectedImage.Height, sBaseImagePath); 123 | vNewIMage.Save(vNewImageName); 124 | Logger.WriteVerbose("Created Image for {0} of iOS Images", vSelSize); 125 | } 126 | lbliOSTitle.Visible = true; 127 | lbliOSValue.Text = viOSOutputPath; 128 | lbliOSValue.Visible = true; 129 | } 130 | if (chkAndroid.Checked) 131 | { 132 | var vAndroidPath = vImageOutPath + @"\AndroidImages"; 133 | Directory.CreateDirectory(vAndroidPath); 134 | Logger.WriteVerbose("Created directory {0} for Android Images", vAndroidPath); 135 | 136 | var vDroidSizesFile = vOutPath + @"\SizeJsons\AndroidSizes.json"; 137 | var vDroidSizeJson = File.ReadAllText(vDroidSizesFile); 138 | var vDroidSizes = JsonConvert.DeserializeObject>(vDroidSizeJson); 139 | for (int iCount = 0; iCount < chlLstAndroid.CheckedItems.Count; iCount++) 140 | { 141 | var vSelSize = chlLstAndroid.CheckedItems[iCount].ToString(); 142 | var vSelectedImage = (from SelImage in vDroidSizes 143 | where SelImage.ImageName == vSelSize 144 | select SelImage).SingleOrDefault(); 145 | Logger.WriteVerbose("Creating Image for {0} of Android Images", vSelSize); 146 | var vNewImageName = vAndroidPath + "\\" + vSelSize + ".png"; 147 | var vNewIMage = Scale(vSelectedImage.Width, vSelectedImage.Height, sBaseImagePath); 148 | vNewIMage.Save(vNewImageName); 149 | Logger.WriteVerbose("Created Image for {0} of Android Images", vSelSize); 150 | } 151 | lblAndroid.Visible = true; 152 | lblAndroidValue.Text = vAndroidPath; 153 | lblAndroidValue.Visible = true; 154 | } 155 | if (chkUwp.Checked) 156 | { 157 | var vUwpPath = vImageOutPath + @"\UwpImages"; 158 | Directory.CreateDirectory(vUwpPath); 159 | Logger.WriteVerbose("Created directory {0} for Uwp Images", vUwpPath); 160 | 161 | var vUwpSizesFile = vOutPath + @"\SizeJsons\UwpSizes.json"; 162 | var vUwpSizeJson = File.ReadAllText(vUwpSizesFile); 163 | var vUwpSizes = JsonConvert.DeserializeObject>(vUwpSizeJson); 164 | for (int iCount = 0; iCount < chkLstUwp.CheckedItems.Count; iCount++) 165 | { 166 | var vSelSize = chkLstUwp.CheckedItems[iCount].ToString(); 167 | var vSelectedImage = (from SelImage in vUwpSizes 168 | where SelImage.ImageName == vSelSize 169 | select SelImage).SingleOrDefault(); 170 | Logger.WriteVerbose("Creating Image for {0} of UWP Images", vSelSize); 171 | var vNewImageName = vUwpPath + "\\" + vSelSize + ".png"; 172 | var vNewIMage = Scale(vSelectedImage.Width, vSelectedImage.Height, sBaseImagePath); 173 | vNewIMage.Save(vNewImageName); 174 | Logger.WriteVerbose("Created Image for {0} of UWP Images", vSelSize); 175 | } 176 | 177 | lblUWPTitle.Visible = true; 178 | lblUWPValues.Text = vUwpPath; 179 | lblUWPValues.Visible = true; 180 | } 181 | } 182 | 183 | public Image Scale(int newWidth, int newHeight, string stPhotoPath) 184 | { 185 | using (var imgPhoto = Image.FromFile(stPhotoPath)) 186 | { 187 | var sourceWidth = imgPhoto.Width; 188 | var sourceHeight = imgPhoto.Height; 189 | 190 | const int sourceX = 0; 191 | const int sourceY = 0; 192 | int destinationX = 0, destinationY = 0; 193 | 194 | float nPercent; 195 | var nPercentW = newWidth / (float)sourceWidth; 196 | var nPercentH = newHeight / (float)sourceHeight; 197 | if (nPercentH < nPercentW) 198 | { 199 | nPercent = nPercentH; 200 | destinationX = Convert.ToInt16((newWidth - 201 | sourceWidth * nPercent) / 2); 202 | } 203 | else 204 | { 205 | nPercent = nPercentW; 206 | destinationY = Convert.ToInt16((newHeight - 207 | sourceHeight * nPercent) / 2); 208 | } 209 | 210 | var destinationWidth = (int)(sourceWidth * nPercent); 211 | var destinationHeight = (int)(sourceHeight * nPercent); 212 | 213 | 214 | var bmPhoto = new Bitmap(newWidth, newHeight); 215 | bmPhoto.SetResolution(imgPhoto.HorizontalResolution, 216 | imgPhoto.VerticalResolution); 217 | 218 | using (var grPhoto = Graphics.FromImage(bmPhoto)) 219 | { 220 | grPhoto.SmoothingMode = SmoothingMode.HighQuality; 221 | grPhoto.InterpolationMode = InterpolationMode.HighQualityBicubic; 222 | grPhoto.PixelOffsetMode = PixelOffsetMode.HighQuality; 223 | grPhoto.DrawImage(imgPhoto, 224 | new Rectangle(destinationX, destinationY, destinationWidth, destinationHeight), 225 | new Rectangle(sourceX, sourceY, sourceWidth, sourceHeight), 226 | GraphicsUnit.Pixel); 227 | } 228 | return bmPhoto; 229 | } 230 | } 231 | 232 | 233 | private static string SerializeToXML(T obj) 234 | { 235 | var serializer = new XmlSerializer(obj.GetType()); 236 | using (var writer = new StringWriter()) 237 | { 238 | serializer.Serialize(writer, obj); 239 | return writer.ToString(); 240 | } 241 | } 242 | private static T DeserializeFromXML(string xml) 243 | { 244 | T result; 245 | var ser = new XmlSerializer(typeof(T)); 246 | using (TextReader tr = new StringReader(xml)) 247 | { 248 | result = (T)ser.Deserialize(tr); 249 | } 250 | return result; 251 | } 252 | 253 | private void btnResize_Click(object sender, EventArgs e) 254 | { 255 | if (!chkAndroid.Checked && !chkiOS.Checked && !chkUwp.Checked) 256 | { 257 | MessageBox.Show("Please Select the Mobile OS"); 258 | } 259 | else 260 | { 261 | CreateImages(lblBaseImagePath.Text.Trim()); 262 | MessageBox.Show("All Images Created"); 263 | } 264 | } 265 | 266 | 267 | } 268 | 269 | [Serializable] 270 | public class AppImage 271 | { 272 | public string ImageName { get; set; } 273 | public short Width { get; set; } 274 | public short Height { get; set; } 275 | public string Scale { get; set; } 276 | } 277 | } 278 | -------------------------------------------------------------------------------- /ReSizer/ReSizerTool.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /ReSizer/SizeJsons/AndroidSizes.json: -------------------------------------------------------------------------------- 1 |  [ 2 | { 3 | "ImageName": "Idpi", 4 | "Width": "36", 5 | "Height": "36", 6 | "Scale": "Idpi" 7 | }, 8 | { 9 | "ImageName": "Mdpi", 10 | "Width": "48", 11 | "Height": "48", 12 | "Scale": "Mdpi" 13 | }, 14 | { 15 | "ImageName": "Hdpi", 16 | "Width": "72", 17 | "Height": "72", 18 | "Scale": "Hdpi" 19 | }, 20 | { 21 | "ImageName": "xHdpi", 22 | "Width": "96", 23 | "Height": "96", 24 | "Scale": "xHdpi" 25 | }, 26 | { 27 | "ImageName": "xxHdpi", 28 | "Width": "144", 29 | "Height": "144", 30 | "Scale": "xxHdpi" 31 | }, 32 | { 33 | "ImageName": "xxxHdpi", 34 | "Width": "192", 35 | "Height": "192", 36 | "Scale": "xxxHdpi" 37 | }, 38 | { 39 | "ImageName": "PlayStoreIcon", 40 | "Width": "512", 41 | "Height": "512", 42 | "Scale": "PlayStoreIcon" 43 | } 44 | ] 45 | 46 | -------------------------------------------------------------------------------- /ReSizer/SizeJsons/UwpSizes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ImageName": "284X284", 4 | "Width": "284", 5 | "Height": "284", 6 | "Scale": "Square71LogoScale400" 7 | }, 8 | { 9 | "ImageName": "142X142", 10 | "Width": "142", 11 | "Height": "142", 12 | "Scale": "Square71LogoScale200" 13 | }, 14 | { 15 | "ImageName": "71X71", 16 | "Width": "71", 17 | "Height": "71", 18 | "Scale": "Square71LogoScale100" 19 | }, 20 | { 21 | "ImageName": "107X107", 22 | "Width": "107", 23 | "Height": "107", 24 | "Scale": "Square71LogoScale150" 25 | }, 26 | { 27 | "ImageName": "89X89", 28 | "Width": "89", 29 | "Height": "89", 30 | "Scale": "Square71LogoScale125" 31 | }, 32 | { 33 | "ImageName": "600X600", 34 | "Width": "600", 35 | "Height": "600", 36 | "Scale": "Square150Scale400" 37 | }, 38 | { 39 | "ImageName": "300X300", 40 | "Width": "300", 41 | "Height": "300", 42 | "Scale": "Square150Scale200" 43 | }, 44 | { 45 | "ImageName": "150X150", 46 | "Width": "150", 47 | "Height": "150", 48 | "Scale": "Square150Scale100" 49 | }, 50 | { 51 | "ImageName": "225X225", 52 | "Width": "225", 53 | "Height": "225", 54 | "Scale": "Square150Scale150" 55 | }, 56 | { 57 | "ImageName": "188X188", 58 | "Width": "188", 59 | "Height": "188", 60 | "Scale": "Square150Scale125" 61 | }, 62 | { 63 | "ImageName": "1240X600", 64 | "Width": "1240", 65 | "Height": "600", 66 | "Scale": "Wide310Scale400" 67 | }, 68 | { 69 | "ImageName": "620X300", 70 | "Width": "620", 71 | "Height": "300", 72 | "Scale": "Wide310Scale200" 73 | }, 74 | { 75 | "ImageName": "310X150", 76 | "Width": "310", 77 | "Height": "150", 78 | "Scale": "Wide310Scale100" 79 | }, 80 | { 81 | "ImageName": "465X225", 82 | "Width": "465", 83 | "Height": "225", 84 | "Scale": "Wide310Scale150" 85 | }, 86 | { 87 | "ImageName": "388X188", 88 | "Width": "388", 89 | "Height": "188", 90 | "Scale": "Wide310Scale125" 91 | }, 92 | { 93 | "ImageName": "1240X1240", 94 | "Width": "1240", 95 | "Height": "1240", 96 | "Scale": "Square310Scale400" 97 | }, 98 | { 99 | "ImageName": "620X620", 100 | "Width": "620", 101 | "Height": "620", 102 | "Scale": "Square310Scale200" 103 | }, 104 | { 105 | "ImageName": "310X310", 106 | "Width": "310", 107 | "Height": "310", 108 | "Scale": "Square310Scale100" 109 | }, 110 | { 111 | "ImageName": "465X465", 112 | "Width": "465", 113 | "Height": "465", 114 | "Scale": "Square310Scale150" 115 | }, 116 | { 117 | "ImageName": "388X388", 118 | "Width": "388", 119 | "Height": "388", 120 | "Scale": "Square310Scale125" 121 | }, 122 | { 123 | "ImageName": "176X176", 124 | "Width": "176", 125 | "Height": "176", 126 | "Scale": "Square44Scale400" 127 | }, 128 | { 129 | "ImageName": "88X88", 130 | "Width": "88", 131 | "Height": "88", 132 | "Scale": "Square44Scale200" 133 | }, 134 | { 135 | "ImageName": "44X44", 136 | "Width": "44", 137 | "Height": "44", 138 | "Scale": "Square44Scale100" 139 | }, 140 | { 141 | "ImageName": "66X66", 142 | "Width": "66", 143 | "Height": "66", 144 | "Scale": "Square44Scale150" 145 | }, 146 | { 147 | "ImageName": "55X55", 148 | "Width": "55", 149 | "Height": "55", 150 | "Scale": "Square44Scale125" 151 | }, 152 | { 153 | "ImageName": "256X256", 154 | "Width": "256", 155 | "Height": "256", 156 | "Scale": "TS256" 157 | }, 158 | { 159 | "ImageName": "48X48", 160 | "Width": "48", 161 | "Height": "48", 162 | "Scale": "TS48" 163 | }, 164 | { 165 | "ImageName": "24X24", 166 | "Width": "24", 167 | "Height": "24", 168 | "Scale": "TS24" 169 | }, 170 | { 171 | "ImageName": "16X16", 172 | "Width": "16", 173 | "Height": "16", 174 | "Scale": "TS16" 175 | }, 176 | { 177 | "ImageName": "200X200", 178 | "Width": "200", 179 | "Height": "200", 180 | "Scale": "StoreScale400" 181 | }, 182 | { 183 | "ImageName": "100X100", 184 | "Width": "100", 185 | "Height": "100", 186 | "Scale": "StoreScale200" 187 | }, 188 | { 189 | "ImageName": "75X75", 190 | "Width": "75", 191 | "Height": "75", 192 | "Scale": "StoreScale150" 193 | }, 194 | { 195 | "ImageName": "63X63", 196 | "Width": "63", 197 | "Height": "63", 198 | "Scale": "StoreScale125" 199 | }, 200 | { 201 | "ImageName": "50X50", 202 | "Width": "50", 203 | "Height": "50", 204 | "Scale": "StoreScale100" 205 | } 206 | 207 | ] 208 | 209 | 210 | -------------------------------------------------------------------------------- /ReSizer/SizeJsons/iOSizes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ImageName": "58X58", 4 | "Width": "58", 5 | "Height": "58", 6 | "Scale": "2x" 7 | }, 8 | { 9 | "ImageName": "87X87", 10 | "Width": "87", 11 | "Height": "87", 12 | "Scale": "3x" 13 | }, 14 | { 15 | "ImageName": "80X80", 16 | "Width": "80", 17 | "Height": "80", 18 | "Scale": "2x" 19 | }, 20 | { 21 | "ImageName": "120X120", 22 | "Width": "120", 23 | "Height": "120", 24 | "Scale": "3x" 25 | }, 26 | { 27 | "ImageName": "180X180", 28 | "Width": "180", 29 | "Height": "180", 30 | "Scale": "3x" 31 | }, 32 | { 33 | "ImageName": "29X29", 34 | "Width": "29", 35 | "Height": "29", 36 | "Scale": "1x" 37 | }, 38 | { 39 | "ImageName": "40X40", 40 | "Width": "40", 41 | "Height": "40", 42 | "Scale": "1x" 43 | }, 44 | { 45 | "ImageName": "76X76", 46 | "Width": "76", 47 | "Height": "76", 48 | "Scale": "1x" 49 | }, 50 | { 51 | "ImageName": "152X152", 52 | "Width": "152", 53 | "Height": "152", 54 | "Scale": "2x" 55 | }, 56 | { 57 | "ImageName": "167X167", 58 | "Width": "167", 59 | "Height": "167", 60 | "Scale": "2x" 61 | }, 62 | { 63 | "ImageName": "640X960", 64 | "Width": "640", 65 | "Height": "960", 66 | "Scale": "2x" 67 | }, 68 | { 69 | "ImageName": "640X1136", 70 | "Width": "640", 71 | "Height": "1136", 72 | "Scale": "Retina4" 73 | }, 74 | { 75 | "ImageName": "768X1024", 76 | "Width": "768", 77 | "Height": "1024", 78 | "Scale": "1x" 79 | }, 80 | { 81 | "ImageName": "1536X2048", 82 | "Width": "1536", 83 | "Height": "2048", 84 | "Scale": "2x" 85 | }, 86 | { 87 | "ImageName": "1024X768", 88 | "Width": "1024", 89 | "Height": "768", 90 | "Scale": "1x" 91 | }, 92 | { 93 | "ImageName": "2048X1536", 94 | "Width": "2048", 95 | "Height": "1536", 96 | "Scale": "2x" 97 | } 98 | ] 99 | 100 | -------------------------------------------------------------------------------- /ReSizer/ToolHelpers/ConfigManager.cs: -------------------------------------------------------------------------------- 1 |  2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | 5 | namespace ReSizer.ToolHelpers 6 | { 7 | public class ImageConfigSection : ConfigurationSection 8 | { 9 | [ConfigurationProperty("ImageCollection")] 10 | public ImageConfigElementCollection ImageCollection 11 | { 12 | get { return this["ImageCollection"] as ImageConfigElementCollection; } 13 | } 14 | 15 | public static ImageConfigSection GetConfigSection() 16 | { 17 | return ConfigurationManager.GetSection("ImageConfigSection") as ImageConfigSection; 18 | } 19 | 20 | public static IEnumerable DefaultCollection() 21 | { 22 | return new List 23 | { 24 | new ImageConfigElement("ldpi",@"{0}\Android\drawable-ldpi\{1}",4), 25 | new ImageConfigElement("mdpi",@"{0}\Android\drawable-mdpi\{1}",3), 26 | new ImageConfigElement("hdpi",@"{0}\Android\drawable-hdpi\{1}",2), 27 | new ImageConfigElement("xhdpi",@"{0}\Android\drawable-xhdpi\{1}",1.5), 28 | new ImageConfigElement("xxhdpi",@"{0}\Android\drawable-xxhdpi\{1}",1), 29 | new ImageConfigElement("iOS@1x",@"{0}\iOS\{1}",3), 30 | new ImageConfigElement("iOS@2x",@"{0}\iOS\{1}@2x",1.5), 31 | new ImageConfigElement("iOS@3x",@"{0}\iOS\{1}@3x",1) 32 | }; 33 | } 34 | } 35 | 36 | public class ImageConfigElementCollection : ConfigurationElementCollection 37 | { 38 | public ImageConfigElement this[int index] 39 | { 40 | get { return BaseGet(index) as ImageConfigElement; } 41 | } 42 | 43 | protected override ConfigurationElement CreateNewElement() 44 | { 45 | return new ImageConfigElement(); 46 | } 47 | 48 | protected override object GetElementKey(ConfigurationElement element) 49 | { 50 | return ((ImageConfigElement)element).Key; 51 | } 52 | } 53 | 54 | public class ImageConfigElement : ConfigurationElement 55 | { 56 | private readonly string _key; 57 | private readonly string _pathFormat; 58 | private readonly double? _scale; 59 | 60 | public ImageConfigElement(string key, string pathFormat, double scale) 61 | { 62 | _key = key; 63 | _pathFormat = pathFormat; 64 | _scale = scale; 65 | } 66 | 67 | public ImageConfigElement() { } 68 | 69 | [ConfigurationProperty("key", IsRequired = true)] 70 | public string Key 71 | { 72 | get 73 | { 74 | if (string.IsNullOrWhiteSpace(_key)) 75 | { 76 | return this["key"] as string; 77 | } 78 | return _key; 79 | } 80 | } 81 | 82 | [ConfigurationProperty("pathFormat", IsRequired = true)] 83 | public string PathFormat 84 | { 85 | get 86 | { 87 | if (string.IsNullOrWhiteSpace(_pathFormat)) 88 | { 89 | return this["pathFormat"] as string; 90 | } 91 | return _pathFormat; 92 | } 93 | } 94 | 95 | [ConfigurationProperty("scale", IsRequired = true)] 96 | public double Scale 97 | { 98 | get 99 | { 100 | if (_scale == null) 101 | { 102 | double scale; 103 | double.TryParse(this["scale"].ToString(), out scale); 104 | return scale; 105 | } 106 | return (double)_scale; 107 | } 108 | } 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /ReSizer/ToolHelpers/ImageExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Drawing.Imaging; 3 | 4 | namespace ReSizer.ToolHelpers 5 | { 6 | public static class ImageExtensions 7 | { 8 | /// 9 | /// Extension method to help save out images. If codec is null, it'll save as original format 10 | /// 11 | /// Image to save 12 | /// Path to save it to 13 | /// Codec to save as (can be null). 14 | /// 15 | public static void Save(this Image image, string path, ImageCodecInfo codec, bool dryRun) 16 | { 17 | if (dryRun) 18 | { 19 | Logger.WriteLine("Would have created {0}", path); 20 | } 21 | else 22 | { 23 | if (codec == null) 24 | { 25 | // Saves as original 26 | image.Save(path); 27 | } 28 | else 29 | { 30 | // Saves with customized codec 31 | image.Save(path, codec, null); 32 | } 33 | Logger.WriteLine("Created {0}", path); 34 | } 35 | } 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /ReSizer/ToolHelpers/ImageHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing.Imaging; 4 | using System.Linq; 5 | 6 | namespace ReSizer.ToolHelpers 7 | { 8 | 9 | public static class ImageHelper 10 | { 11 | public static ImageFormat ParseImageFormat(string format) 12 | { 13 | switch (format.Replace(".", "")) 14 | { 15 | case "png": 16 | return ImageFormat.Png; 17 | case "jpg": 18 | return ImageFormat.Jpeg; 19 | case "jpeg": 20 | return ImageFormat.Jpeg; 21 | default: 22 | return null; 23 | } 24 | } 25 | 26 | public static Dictionary> BuildImageInfo(string rootDir, string newName, string extension) 27 | { 28 | var section = ImageConfigSection.GetConfigSection(); 29 | IEnumerable images; 30 | if (section != null) 31 | { 32 | images = from ImageConfigElement i in section.ImageCollection select i; 33 | } 34 | else 35 | { 36 | images = ImageConfigSection.DefaultCollection(); 37 | } 38 | var dict = new Dictionary>(); 39 | foreach (var image in images) 40 | { 41 | var path = string.Format(image.PathFormat, rootDir, newName) + extension; 42 | dict.Add(image.Key, new Tuple(path, image.Scale)); 43 | } 44 | 45 | return dict; 46 | } 47 | 48 | 49 | public static ImageCodecInfo GetImageCodecInfo(ImageFormat format) 50 | { 51 | if (format == null) 52 | { 53 | return null; 54 | } 55 | var codecs = ImageCodecInfo.GetImageEncoders(); 56 | return codecs.FirstOrDefault(codec => codec.FormatID == format.Guid); 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /ReSizer/ToolHelpers/ImageProcessor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Imaging; 4 | using System.IO; 5 | 6 | namespace ReSizer.ToolHelpers 7 | { 8 | public class ImageProcessor 9 | { 10 | private readonly bool _dry; 11 | private readonly string _here; 12 | private readonly ImageScalerService _scalerService; 13 | 14 | public ImageProcessor(bool dry) 15 | { 16 | _dry = dry; 17 | _scalerService = new ImageScalerService(); 18 | _here = Directory.GetCurrentDirectory(); 19 | } 20 | 21 | public void Process(FileInfo image, string outPath, string prefix, string suffix, ImageFormat format) 22 | { 23 | Logger.WriteLine("Processing {0}", image.Name); 24 | var outFileName = string.Format("{0}{1}{2}", prefix, Path.GetFileNameWithoutExtension(image.FullName), suffix); 25 | var rootDir = string.IsNullOrWhiteSpace(outPath) ? Path.GetDirectoryName(_here) : new DirectoryInfo(outPath).FullName; 26 | var extension = format == null ? image.Extension : string.Format(".{0}", format.ToString().ToLower()); 27 | Logger.WriteVerbose("New File Name: {0}{1}", outFileName, extension); 28 | 29 | 30 | int defaultHeight; 31 | int defaultWidth; 32 | 33 | using (var img = Image.FromFile(image.FullName)) 34 | { 35 | defaultHeight = img.Height; 36 | defaultWidth = img.Width; 37 | } 38 | 39 | Logger.WriteVerbose("Original Dimensions: {0}W by {1}H", defaultWidth, defaultHeight); 40 | 41 | var expectedImages = ImageHelper.BuildImageInfo(rootDir, outFileName, extension); 42 | 43 | //DirectoryHelper.SetupPaths(expectedImages, _dry); 44 | 45 | var codec = ImageHelper.GetImageCodecInfo(format); 46 | 47 | foreach (var expectedImage in expectedImages) 48 | { 49 | var path = expectedImage.Value.Item1; 50 | var scale = expectedImage.Value.Item2; 51 | var scaledWidth = (int)Math.Ceiling(defaultWidth / scale); 52 | var scaledHeight = (int)Math.Ceiling(defaultHeight / scale); 53 | var scaledImage = _scalerService.Scale(scaledWidth, scaledHeight, image.FullName); 54 | scaledImage.Save(path, codec, _dry); 55 | 56 | Logger.WriteVerbose("New Dimensions for {0}: {1}W by {2}H", expectedImage.Key, scaledWidth, scaledHeight); 57 | } 58 | Logger.WriteLine(); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ReSizer/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ReadyExecutables/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techierathore/ReSizer/24d81573ccc7064ada756151fd7546254b4c80a3/ReadyExecutables/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /ReadyExecutables/ReSizer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techierathore/ReSizer/24d81573ccc7064ada756151fd7546254b4c80a3/ReadyExecutables/ReSizer.exe -------------------------------------------------------------------------------- /ReadyExecutables/ReSizer.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ReadyExecutables/SizeJsons/AndroidSizes.json: -------------------------------------------------------------------------------- 1 |  [ 2 | { 3 | "ImageName": "Idpi", 4 | "Width": "36", 5 | "Height": "36", 6 | "Scale": "Idpi" 7 | }, 8 | { 9 | "ImageName": "Mdpi", 10 | "Width": "48", 11 | "Height": "48", 12 | "Scale": "Mdpi" 13 | }, 14 | { 15 | "ImageName": "Hdpi", 16 | "Width": "72", 17 | "Height": "72", 18 | "Scale": "Hdpi" 19 | }, 20 | { 21 | "ImageName": "xHdpi", 22 | "Width": "96", 23 | "Height": "96", 24 | "Scale": "xHdpi" 25 | }, 26 | { 27 | "ImageName": "xxHdpi", 28 | "Width": "144", 29 | "Height": "144", 30 | "Scale": "xxHdpi" 31 | }, 32 | { 33 | "ImageName": "xxxHdpi", 34 | "Width": "192", 35 | "Height": "192", 36 | "Scale": "xxxHdpi" 37 | }, 38 | { 39 | "ImageName": "PlayStoreIcon", 40 | "Width": "512", 41 | "Height": "512", 42 | "Scale": "PlayStoreIcon" 43 | } 44 | ] 45 | 46 | -------------------------------------------------------------------------------- /ReadyExecutables/SizeJsons/UwpSizes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ImageName": "284X284", 4 | "Width": "284", 5 | "Height": "284", 6 | "Scale": "Square71LogoScale400" 7 | }, 8 | { 9 | "ImageName": "142X142", 10 | "Width": "142", 11 | "Height": "142", 12 | "Scale": "Square71LogoScale200" 13 | }, 14 | { 15 | "ImageName": "71X71", 16 | "Width": "71", 17 | "Height": "71", 18 | "Scale": "Square71LogoScale100" 19 | }, 20 | { 21 | "ImageName": "107X107", 22 | "Width": "107", 23 | "Height": "107", 24 | "Scale": "Square71LogoScale150" 25 | }, 26 | { 27 | "ImageName": "89X89", 28 | "Width": "89", 29 | "Height": "89", 30 | "Scale": "Square71LogoScale125" 31 | }, 32 | { 33 | "ImageName": "600X600", 34 | "Width": "600", 35 | "Height": "600", 36 | "Scale": "Square150Scale400" 37 | }, 38 | { 39 | "ImageName": "300X300", 40 | "Width": "300", 41 | "Height": "300", 42 | "Scale": "Square150Scale200" 43 | }, 44 | { 45 | "ImageName": "150X150", 46 | "Width": "150", 47 | "Height": "150", 48 | "Scale": "Square150Scale100" 49 | }, 50 | { 51 | "ImageName": "225X225", 52 | "Width": "225", 53 | "Height": "225", 54 | "Scale": "Square150Scale150" 55 | }, 56 | { 57 | "ImageName": "188X188", 58 | "Width": "188", 59 | "Height": "188", 60 | "Scale": "Square150Scale125" 61 | }, 62 | { 63 | "ImageName": "1240X600", 64 | "Width": "1240", 65 | "Height": "600", 66 | "Scale": "Wide310Scale400" 67 | }, 68 | { 69 | "ImageName": "620X300", 70 | "Width": "620", 71 | "Height": "300", 72 | "Scale": "Wide310Scale200" 73 | }, 74 | { 75 | "ImageName": "310X150", 76 | "Width": "310", 77 | "Height": "150", 78 | "Scale": "Wide310Scale100" 79 | }, 80 | { 81 | "ImageName": "465X225", 82 | "Width": "465", 83 | "Height": "225", 84 | "Scale": "Wide310Scale150" 85 | }, 86 | { 87 | "ImageName": "388X188", 88 | "Width": "388", 89 | "Height": "188", 90 | "Scale": "Wide310Scale125" 91 | }, 92 | { 93 | "ImageName": "1240X1240", 94 | "Width": "1240", 95 | "Height": "1240", 96 | "Scale": "Square310Scale400" 97 | }, 98 | { 99 | "ImageName": "620X620", 100 | "Width": "620", 101 | "Height": "620", 102 | "Scale": "Square310Scale200" 103 | }, 104 | { 105 | "ImageName": "310X310", 106 | "Width": "310", 107 | "Height": "310", 108 | "Scale": "Square310Scale100" 109 | }, 110 | { 111 | "ImageName": "465X465", 112 | "Width": "465", 113 | "Height": "465", 114 | "Scale": "Square310Scale150" 115 | }, 116 | { 117 | "ImageName": "388X388", 118 | "Width": "388", 119 | "Height": "388", 120 | "Scale": "Square310Scale125" 121 | }, 122 | { 123 | "ImageName": "176X176", 124 | "Width": "176", 125 | "Height": "176", 126 | "Scale": "Square44Scale400" 127 | }, 128 | { 129 | "ImageName": "88X88", 130 | "Width": "88", 131 | "Height": "88", 132 | "Scale": "Square44Scale200" 133 | }, 134 | { 135 | "ImageName": "44X44", 136 | "Width": "44", 137 | "Height": "44", 138 | "Scale": "Square44Scale100" 139 | }, 140 | { 141 | "ImageName": "66X66", 142 | "Width": "66", 143 | "Height": "66", 144 | "Scale": "Square44Scale150" 145 | }, 146 | { 147 | "ImageName": "55X55", 148 | "Width": "55", 149 | "Height": "55", 150 | "Scale": "Square44Scale125" 151 | }, 152 | { 153 | "ImageName": "256X256", 154 | "Width": "256", 155 | "Height": "256", 156 | "Scale": "TS256" 157 | }, 158 | { 159 | "ImageName": "48X48", 160 | "Width": "48", 161 | "Height": "48", 162 | "Scale": "TS48" 163 | }, 164 | { 165 | "ImageName": "24X24", 166 | "Width": "24", 167 | "Height": "24", 168 | "Scale": "TS24" 169 | }, 170 | { 171 | "ImageName": "16X16", 172 | "Width": "16", 173 | "Height": "16", 174 | "Scale": "TS16" 175 | }, 176 | { 177 | "ImageName": "200X200", 178 | "Width": "200", 179 | "Height": "200", 180 | "Scale": "StoreScale400" 181 | }, 182 | { 183 | "ImageName": "100X100", 184 | "Width": "100", 185 | "Height": "100", 186 | "Scale": "StoreScale200" 187 | }, 188 | { 189 | "ImageName": "75X75", 190 | "Width": "75", 191 | "Height": "75", 192 | "Scale": "StoreScale150" 193 | }, 194 | { 195 | "ImageName": "63X63", 196 | "Width": "63", 197 | "Height": "63", 198 | "Scale": "StoreScale125" 199 | }, 200 | { 201 | "ImageName": "50X50", 202 | "Width": "50", 203 | "Height": "50", 204 | "Scale": "StoreScale100" 205 | } 206 | 207 | ] 208 | 209 | 210 | -------------------------------------------------------------------------------- /ReadyExecutables/SizeJsons/iOSizes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ImageName": "58X58", 4 | "Width": "58", 5 | "Height": "58", 6 | "Scale": "2x" 7 | }, 8 | { 9 | "ImageName": "87X87", 10 | "Width": "87", 11 | "Height": "87", 12 | "Scale": "3x" 13 | }, 14 | { 15 | "ImageName": "80X80", 16 | "Width": "80", 17 | "Height": "80", 18 | "Scale": "2x" 19 | }, 20 | { 21 | "ImageName": "120X120", 22 | "Width": "120", 23 | "Height": "120", 24 | "Scale": "3x" 25 | }, 26 | { 27 | "ImageName": "180X180", 28 | "Width": "180", 29 | "Height": "180", 30 | "Scale": "3x" 31 | }, 32 | { 33 | "ImageName": "29X29", 34 | "Width": "29", 35 | "Height": "29", 36 | "Scale": "1x" 37 | }, 38 | { 39 | "ImageName": "40X40", 40 | "Width": "40", 41 | "Height": "40", 42 | "Scale": "1x" 43 | }, 44 | { 45 | "ImageName": "76X76", 46 | "Width": "76", 47 | "Height": "76", 48 | "Scale": "1x" 49 | }, 50 | { 51 | "ImageName": "152X152", 52 | "Width": "152", 53 | "Height": "152", 54 | "Scale": "2x" 55 | }, 56 | { 57 | "ImageName": "167X167", 58 | "Width": "167", 59 | "Height": "167", 60 | "Scale": "2x" 61 | }, 62 | { 63 | "ImageName": "640X960", 64 | "Width": "640", 65 | "Height": "960", 66 | "Scale": "2x" 67 | }, 68 | { 69 | "ImageName": "640X1136", 70 | "Width": "640", 71 | "Height": "1136", 72 | "Scale": "Retina4" 73 | }, 74 | { 75 | "ImageName": "768X1024", 76 | "Width": "768", 77 | "Height": "1024", 78 | "Scale": "1x" 79 | }, 80 | { 81 | "ImageName": "1536X2048", 82 | "Width": "1536", 83 | "Height": "2048", 84 | "Scale": "2x" 85 | }, 86 | { 87 | "ImageName": "1024X768", 88 | "Width": "1024", 89 | "Height": "768", 90 | "Scale": "1x" 91 | }, 92 | { 93 | "ImageName": "2048X1536", 94 | "Width": "2048", 95 | "Height": "1536", 96 | "Scale": "2x" 97 | } 98 | ] 99 | 100 | --------------------------------------------------------------------------------