├── .gitattributes ├── .gitignore ├── README.md ├── krkrFgiEditor.sln └── krkrFgiEditor ├── App.config ├── BatchWin.Designer.cs ├── BatchWin.cs ├── BatchWin.resx ├── ComboBoxEx.Designer.cs ├── ComboBoxEx.cs ├── ListBoxEx.Designer.cs ├── ListBoxEx.cs ├── MainWin.Designer.cs ├── MainWin.cs ├── MainWin.resx ├── PictureWin.Designer.cs ├── PictureWin.cs ├── PictureWin.resx ├── Program.cs ├── ProgressWin.Designer.cs ├── ProgressWin.cs ├── ProgressWin.resx ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── app.manifest ├── krkrFgiEditor.csproj └── krkrFgiEditor.ico /.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 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # krkrFgiEditor 2 | 吉里吉里立绘合成工具 3 | 4 | ## 一、合成单张立绘 5 | 6 | 1、打开坐标文件,格式为txt或json,名字一般为角色名,如:芳乃a.txt、寧々a_0.txt、face白狗a.txt、あやせa.pbd.json等。 7 | 8 | 2、程序会自动检测坐标文件的编码格式,原理为计算用各种编码打开时非日非英的字符数量,然后选用超范围的字符数量最少的编码。 9 | 10 | 3、选择图层,坐标文件中未指定图层组的图层统一放在名为“(none)”的图层组中。 11 | 12 | 4、在图层框中越上面的图层合成时铺在越底下,默认在添加图层时会对已选择的图层自动排序,原理为计算每个图层所有像素Alpha值的总和,和越大的图层铺在越底下。 13 | 14 | 5、保存结果。 15 | 16 | ## 二、批量合成 17 | 18 | 1、点击“新建”在左框中创建新的图层组,选中某一图层组后在右框中添加相应的图层。 19 | 20 | 2、选中图层或图层组后按backspace可以移除该项。 21 | 22 | 3、合成时越上面的图层组铺在越底下,图层组中图层的顺序不会影响合成结果。 23 | 24 | 4、选中右框中的任一图层后按“新建”可以添加名为“(none)”的空白图层。一个图层组最多只能有一个空白图层,且必须包含空白图层以外的图层。 25 | 26 | 5、合成规则。 27 | 28 | 假如有如下三个图层组: 29 | 30 | 组1:1、2 31 | 32 | 组2:3、(none) 33 | 34 | 组3:4、5 35 | 36 | 那么合成的结果为:1+3+4、1+3+5、1+4、1+5、2+3+4、2+3+5、2+4、2+5。 37 | 38 | 6、选择保存路径。 39 | 40 | 7、点击“开始合成”。 41 | -------------------------------------------------------------------------------- /krkrFgiEditor.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32616.157 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "krkrFgiEditor", "krkrFgiEditor\krkrFgiEditor.csproj", "{74C73890-7AA6-49FC-8C86-CE1FE18ED307}" 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 | {74C73890-7AA6-49FC-8C86-CE1FE18ED307}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {74C73890-7AA6-49FC-8C86-CE1FE18ED307}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {74C73890-7AA6-49FC-8C86-CE1FE18ED307}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {74C73890-7AA6-49FC-8C86-CE1FE18ED307}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {DB33AEF0-4AD8-40F4-9707-652C0555AEE1} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /krkrFgiEditor/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /krkrFgiEditor/BatchWin.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace krkrFgiEditor 2 | { 3 | partial class BatchWin 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.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BatchWin)); 33 | this.layerPanel = new System.Windows.Forms.GroupBox(); 34 | this.deleteButton = new System.Windows.Forms.Button(); 35 | this.upButton = new System.Windows.Forms.Button(); 36 | this.downButton = new System.Windows.Forms.Button(); 37 | this.createButton = new System.Windows.Forms.Button(); 38 | this.addButton = new System.Windows.Forms.Button(); 39 | this.addGroupButton = new System.Windows.Forms.Button(); 40 | this.layerBox = new System.Windows.Forms.ComboBox(); 41 | this.layerLabel = new System.Windows.Forms.Label(); 42 | this.groupBox = new System.Windows.Forms.ComboBox(); 43 | this.groupLabel = new System.Windows.Forms.Label(); 44 | this.savePanel = new System.Windows.Forms.GroupBox(); 45 | this.savePath = new System.Windows.Forms.TextBox(); 46 | this.openFolder = new System.Windows.Forms.Button(); 47 | this.confirmButton = new System.Windows.Forms.Button(); 48 | this.listBoxTip = new System.Windows.Forms.ToolTip(this.components); 49 | this.groupList = new krkrFgiEditor.ListBoxEx(); 50 | this.layerList = new krkrFgiEditor.ListBoxEx(); 51 | this.layerPanel.SuspendLayout(); 52 | this.savePanel.SuspendLayout(); 53 | this.SuspendLayout(); 54 | // 55 | // layerPanel 56 | // 57 | this.layerPanel.Controls.Add(this.groupList); 58 | this.layerPanel.Controls.Add(this.deleteButton); 59 | this.layerPanel.Controls.Add(this.upButton); 60 | this.layerPanel.Controls.Add(this.downButton); 61 | this.layerPanel.Controls.Add(this.createButton); 62 | this.layerPanel.Controls.Add(this.addButton); 63 | this.layerPanel.Controls.Add(this.addGroupButton); 64 | this.layerPanel.Controls.Add(this.layerList); 65 | this.layerPanel.Controls.Add(this.layerBox); 66 | this.layerPanel.Controls.Add(this.layerLabel); 67 | this.layerPanel.Controls.Add(this.groupBox); 68 | this.layerPanel.Controls.Add(this.groupLabel); 69 | this.layerPanel.Location = new System.Drawing.Point(12, 12); 70 | this.layerPanel.Name = "layerPanel"; 71 | this.layerPanel.Size = new System.Drawing.Size(549, 312); 72 | this.layerPanel.TabIndex = 0; 73 | this.layerPanel.TabStop = false; 74 | this.layerPanel.Text = "图层选择"; 75 | // 76 | // deleteButton 77 | // 78 | this.deleteButton.Enabled = false; 79 | this.deleteButton.Location = new System.Drawing.Point(227, 164); 80 | this.deleteButton.Name = "deleteButton"; 81 | this.deleteButton.Size = new System.Drawing.Size(100, 35); 82 | this.deleteButton.TabIndex = 8; 83 | this.deleteButton.Text = "删除"; 84 | this.deleteButton.UseVisualStyleBackColor = true; 85 | this.deleteButton.Click += new System.EventHandler(this.DeleteButton_Click); 86 | // 87 | // upButton 88 | // 89 | this.upButton.Enabled = false; 90 | this.upButton.Location = new System.Drawing.Point(227, 205); 91 | this.upButton.Name = "upButton"; 92 | this.upButton.Size = new System.Drawing.Size(100, 35); 93 | this.upButton.TabIndex = 9; 94 | this.upButton.Text = "上移"; 95 | this.upButton.UseVisualStyleBackColor = true; 96 | this.upButton.Click += new System.EventHandler(this.UpButton_Click); 97 | // 98 | // downButton 99 | // 100 | this.downButton.Enabled = false; 101 | this.downButton.Location = new System.Drawing.Point(227, 246); 102 | this.downButton.Name = "downButton"; 103 | this.downButton.Size = new System.Drawing.Size(100, 35); 104 | this.downButton.TabIndex = 10; 105 | this.downButton.Text = "下移"; 106 | this.downButton.UseVisualStyleBackColor = true; 107 | this.downButton.Click += new System.EventHandler(this.DownButton_Click); 108 | // 109 | // createButton 110 | // 111 | this.createButton.Location = new System.Drawing.Point(227, 123); 112 | this.createButton.Name = "createButton"; 113 | this.createButton.Size = new System.Drawing.Size(100, 35); 114 | this.createButton.TabIndex = 7; 115 | this.createButton.Text = "新建"; 116 | this.createButton.UseVisualStyleBackColor = true; 117 | this.createButton.Click += new System.EventHandler(this.CreateButton_Click); 118 | // 119 | // addButton 120 | // 121 | this.addButton.Enabled = false; 122 | this.addButton.Location = new System.Drawing.Point(418, 71); 123 | this.addButton.Name = "addButton"; 124 | this.addButton.Size = new System.Drawing.Size(120, 35); 125 | this.addButton.TabIndex = 5; 126 | this.addButton.Text = "添加"; 127 | this.addButton.UseVisualStyleBackColor = true; 128 | this.addButton.Click += new System.EventHandler(this.AddButton_Click); 129 | // 130 | // addGroupButton 131 | // 132 | this.addGroupButton.Location = new System.Drawing.Point(418, 30); 133 | this.addGroupButton.Name = "addGroupButton"; 134 | this.addGroupButton.Size = new System.Drawing.Size(120, 35); 135 | this.addGroupButton.TabIndex = 2; 136 | this.addGroupButton.Text = "添加组"; 137 | this.addGroupButton.UseVisualStyleBackColor = true; 138 | this.addGroupButton.Click += new System.EventHandler(this.AddGroupButton_Click); 139 | // 140 | // layerBox 141 | // 142 | this.layerBox.BackColor = System.Drawing.SystemColors.Window; 143 | this.layerBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; 144 | this.layerBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 145 | this.layerBox.Font = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); 146 | this.layerBox.Location = new System.Drawing.Point(98, 72); 147 | this.layerBox.MaxDropDownItems = 40; 148 | this.layerBox.Name = "layerBox"; 149 | this.layerBox.Size = new System.Drawing.Size(314, 32); 150 | this.layerBox.TabIndex = 4; 151 | this.layerBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.LayerBox_DrawItem); 152 | this.layerBox.SelectedIndexChanged += new System.EventHandler(this.LayerBox_SelectedIndexChanged); 153 | // 154 | // layerLabel 155 | // 156 | this.layerLabel.AutoSize = true; 157 | this.layerLabel.Location = new System.Drawing.Point(28, 76); 158 | this.layerLabel.Name = "layerLabel"; 159 | this.layerLabel.Size = new System.Drawing.Size(46, 24); 160 | this.layerLabel.TabIndex = 3; 161 | this.layerLabel.Text = "图层"; 162 | // 163 | // groupBox 164 | // 165 | this.groupBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 166 | this.groupBox.Font = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); 167 | this.groupBox.FormattingEnabled = true; 168 | this.groupBox.Location = new System.Drawing.Point(98, 31); 169 | this.groupBox.Name = "groupBox"; 170 | this.groupBox.Size = new System.Drawing.Size(314, 33); 171 | this.groupBox.TabIndex = 1; 172 | this.groupBox.SelectedIndexChanged += new System.EventHandler(this.GroupBox_SelectedIndexChanged); 173 | // 174 | // groupLabel 175 | // 176 | this.groupLabel.AutoSize = true; 177 | this.groupLabel.Location = new System.Drawing.Point(19, 35); 178 | this.groupLabel.Name = "groupLabel"; 179 | this.groupLabel.Size = new System.Drawing.Size(64, 24); 180 | this.groupLabel.TabIndex = 0; 181 | this.groupLabel.Text = "图层组"; 182 | // 183 | // savePanel 184 | // 185 | this.savePanel.Controls.Add(this.savePath); 186 | this.savePanel.Controls.Add(this.openFolder); 187 | this.savePanel.Location = new System.Drawing.Point(12, 330); 188 | this.savePanel.Name = "savePanel"; 189 | this.savePanel.Size = new System.Drawing.Size(549, 83); 190 | this.savePanel.TabIndex = 1; 191 | this.savePanel.TabStop = false; 192 | this.savePanel.Text = "保存路径"; 193 | // 194 | // savePath 195 | // 196 | this.savePath.Location = new System.Drawing.Point(16, 32); 197 | this.savePath.Name = "savePath"; 198 | this.savePath.Size = new System.Drawing.Size(396, 31); 199 | this.savePath.TabIndex = 0; 200 | this.savePath.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.SavePath_KeyPress); 201 | // 202 | // openFolder 203 | // 204 | this.openFolder.Location = new System.Drawing.Point(418, 30); 205 | this.openFolder.Name = "openFolder"; 206 | this.openFolder.Size = new System.Drawing.Size(120, 34); 207 | this.openFolder.TabIndex = 1; 208 | this.openFolder.Text = "打开文件夹"; 209 | this.openFolder.UseVisualStyleBackColor = true; 210 | this.openFolder.Click += new System.EventHandler(this.OpenFolder_Click); 211 | // 212 | // confirmButton 213 | // 214 | this.confirmButton.Enabled = false; 215 | this.confirmButton.Location = new System.Drawing.Point(211, 433); 216 | this.confirmButton.Name = "confirmButton"; 217 | this.confirmButton.Size = new System.Drawing.Size(150, 35); 218 | this.confirmButton.TabIndex = 2; 219 | this.confirmButton.Text = "开始合成"; 220 | this.confirmButton.UseVisualStyleBackColor = true; 221 | this.confirmButton.Click += new System.EventHandler(this.ConfirmButton_Click); 222 | // 223 | // groupList 224 | // 225 | this.groupList.AllowDrop = true; 226 | this.groupList.Font = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); 227 | this.groupList.FormattingEnabled = true; 228 | this.groupList.ItemHeight = 25; 229 | this.groupList.Location = new System.Drawing.Point(16, 113); 230 | this.groupList.Name = "groupList"; 231 | this.groupList.Size = new System.Drawing.Size(205, 179); 232 | this.groupList.TabIndex = 6; 233 | this.groupList.ItemsChanged += new System.EventHandler(this.ListItemsChanged); 234 | this.groupList.SelectedIndexChanged += new System.EventHandler(this.GroupList_SelectedIndexChanged); 235 | this.groupList.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.GroupList_KeyPress); 236 | // 237 | // layerList 238 | // 239 | this.layerList.AllowDrop = true; 240 | this.layerList.Font = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); 241 | this.layerList.FormattingEnabled = true; 242 | this.layerList.ItemHeight = 25; 243 | this.layerList.Location = new System.Drawing.Point(333, 113); 244 | this.layerList.Name = "layerList"; 245 | this.layerList.Size = new System.Drawing.Size(205, 179); 246 | this.layerList.TabIndex = 11; 247 | this.layerList.ItemsChanged += new System.EventHandler(this.ListItemsChanged); 248 | this.layerList.SelectedIndexChanged += new System.EventHandler(this.LayerList_SelectedIndexChanged); 249 | this.layerList.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.LayerList_KeyPress); 250 | // 251 | // BatchWin 252 | // 253 | this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F); 254 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 255 | this.ClientSize = new System.Drawing.Size(573, 489); 256 | this.Controls.Add(this.confirmButton); 257 | this.Controls.Add(this.savePanel); 258 | this.Controls.Add(this.layerPanel); 259 | this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 260 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 261 | this.HelpButton = true; 262 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 263 | this.Margin = new System.Windows.Forms.Padding(4); 264 | this.MaximizeBox = false; 265 | this.MinimizeBox = false; 266 | this.Name = "BatchWin"; 267 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 268 | this.Text = "批量合成"; 269 | this.HelpButtonClicked += new System.ComponentModel.CancelEventHandler(this.BatchWin_HelpButtonClicked); 270 | this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.BatchWin_FormClosed); 271 | this.layerPanel.ResumeLayout(false); 272 | this.layerPanel.PerformLayout(); 273 | this.savePanel.ResumeLayout(false); 274 | this.savePanel.PerformLayout(); 275 | this.ResumeLayout(false); 276 | 277 | } 278 | 279 | #endregion 280 | 281 | private System.Windows.Forms.GroupBox layerPanel; 282 | private System.Windows.Forms.Button addButton; 283 | private System.Windows.Forms.Button addGroupButton; 284 | private ListBoxEx layerList; 285 | private System.Windows.Forms.ComboBox layerBox; 286 | private System.Windows.Forms.Label layerLabel; 287 | private System.Windows.Forms.ComboBox groupBox; 288 | private System.Windows.Forms.Label groupLabel; 289 | private ListBoxEx groupList; 290 | private System.Windows.Forms.Button deleteButton; 291 | private System.Windows.Forms.Button upButton; 292 | private System.Windows.Forms.Button downButton; 293 | private System.Windows.Forms.Button createButton; 294 | private System.Windows.Forms.GroupBox savePanel; 295 | private System.Windows.Forms.TextBox savePath; 296 | private System.Windows.Forms.Button openFolder; 297 | private System.Windows.Forms.Button confirmButton; 298 | private System.Windows.Forms.ToolTip listBoxTip; 299 | } 300 | } -------------------------------------------------------------------------------- /krkrFgiEditor/BatchWin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.IO; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | using System.Windows.Forms; 9 | 10 | namespace krkrFgiEditor 11 | { 12 | public partial class BatchWin : Form 13 | { 14 | public BatchWin(Action setGroups, 15 | Action setLayerBox, 16 | Action measureItem, 17 | Action drawItem, 18 | Func getLayer, 19 | Func, string> getName) 20 | { 21 | InitializeComponent(); 22 | groups = new List>(); 23 | SetLayerBox = setLayerBox; 24 | layerBox.MeasureItem += new MeasureItemEventHandler(measureItem); 25 | DrawItem = drawItem; 26 | GetLayer = getLayer; 27 | GetName = getName; 28 | listBoxTip.SetToolTip(groupList, "按backspace删除当前项"); 29 | listBoxTip.SetToolTip(layerList, "按backspace删除当前项"); 30 | setGroups(groupBox); 31 | } 32 | 33 | private int count = 1; 34 | private readonly List> groups; 35 | private readonly Action SetLayerBox; 36 | private readonly Action DrawItem; 37 | private readonly Func GetLayer; 38 | private readonly Func, string> GetName; 39 | 40 | private void BatchWin_HelpButtonClicked(object sender, CancelEventArgs e) 41 | { 42 | e.Cancel = true; 43 | MessageBox.Show("合成顺序:按照组的顺序从上往下依次覆盖\n" + 44 | "合成规则:合成时遍历组内的所有图层", "帮助", 45 | MessageBoxButtons.OK, MessageBoxIcon.Information); 46 | } 47 | 48 | private void OpenFolder_Click(object sender, EventArgs e) 49 | { 50 | FolderBrowserDialog fbd = new FolderBrowserDialog(); 51 | if (fbd.ShowDialog() == DialogResult.OK) 52 | savePath.Text = fbd.SelectedPath; 53 | fbd.Dispose(); 54 | } 55 | 56 | private void SavePath_KeyPress(object sender, KeyPressEventArgs e) 57 | { 58 | if (e.KeyChar == '\r') 59 | CreateFolder(savePath.Text); 60 | } 61 | 62 | private bool CreateFolder(string path) 63 | { 64 | if (string.IsNullOrEmpty(path)) 65 | { 66 | MessageBox.Show("请指定保存路径!", "", 67 | MessageBoxButtons.OK, MessageBoxIcon.Warning); 68 | return false; 69 | } 70 | if (!Directory.Exists(path)) 71 | { 72 | if (MessageBox.Show("该文件夹不存在,是否新建文件夹?", "", 73 | MessageBoxButtons.OKCancel, 74 | MessageBoxIcon.Information) == DialogResult.OK) 75 | { 76 | string[] folders = path.Split('\\'); 77 | string fpath = ""; 78 | foreach (string folder in folders) 79 | { 80 | fpath += folder + "/"; 81 | if (Directory.Exists(fpath)) 82 | continue; 83 | try 84 | { 85 | Directory.CreateDirectory(fpath); 86 | } 87 | catch 88 | { 89 | MessageBox.Show("路径名称不合法!", "", 90 | MessageBoxButtons.OK, MessageBoxIcon.Error); 91 | return false; 92 | } 93 | } 94 | } 95 | if (!Directory.Exists(path)) 96 | { 97 | MessageBox.Show("新建文件夹失败!", "", 98 | MessageBoxButtons.OK, MessageBoxIcon.Error); 99 | return false; 100 | } 101 | return true; 102 | } 103 | return true; 104 | } 105 | 106 | private void BatchWin_FormClosed(object sender, FormClosedEventArgs e) 107 | { 108 | GC.Collect(); 109 | } 110 | 111 | private void ConfirmButton_Click(object sender, EventArgs e) 112 | { 113 | if (!CreateFolder(savePath.Text)) 114 | return; 115 | ProgressWin pw = new ProgressWin(NumOfImages()); 116 | Task task = Task.Run(() => 117 | { 118 | if (GenerateImage(new List(), 0, pw, pw.cts.Token)) 119 | { 120 | Invoke(new Action(pw.Close)); 121 | MessageBox.Show("合成结束!", "", 122 | MessageBoxButtons.OK, MessageBoxIcon.Information); 123 | } 124 | }); 125 | pw.ShowDialog(); 126 | pw.Dispose(); 127 | } 128 | 129 | private int NumOfImages() 130 | { 131 | int num = 1; 132 | foreach (List layers in groups) 133 | num *= layers.Count; 134 | return num; 135 | } 136 | 137 | private bool GenerateImage(List layers, int index, 138 | ProgressWin pw, CancellationToken token) 139 | { 140 | if (index < groups.Count) 141 | { 142 | foreach (Layer layer in groups[index]) 143 | if (!GenerateImage(new List(layers) { layer }, 144 | index + 1, pw, token)) 145 | return false; 146 | } 147 | else 148 | { 149 | if (token.IsCancellationRequested) 150 | return false; 151 | BeginInvoke(new Action(pw.AddProgress)); 152 | Image result = Layer.GenerateImage(layers); 153 | if (result != null) 154 | { 155 | result.Save(Path.Combine(savePath.Text, 156 | GetName(layers) + ".png")); 157 | result.Dispose(); 158 | } 159 | } 160 | return true; 161 | } 162 | 163 | private bool IsCompleted() 164 | { 165 | if (groups.Count == 0) 166 | return false; 167 | foreach (List group in groups) 168 | if (group.Count - (Layer.HasNone(group) ? 1 : 0) == 0) 169 | return false; 170 | return true; 171 | } 172 | 173 | private void ListItemsChanged(object sender, EventArgs e) 174 | { 175 | if (!((ListBoxEx)sender).Enabled) 176 | return; 177 | confirmButton.Enabled = IsCompleted(); 178 | CheckAddGroupButton(); 179 | CheckAddButton(); 180 | CheckSelected(); 181 | } 182 | 183 | private void CheckAddGroupButton() 184 | { 185 | if (groupList.Items.Contains(groupBox.SelectedItem)) 186 | addGroupButton.Enabled = false; 187 | else 188 | addGroupButton.Enabled = true; 189 | } 190 | 191 | private void CheckSelected() 192 | { 193 | if (groupList.SelectedIndex == -1) 194 | { 195 | upButton.Enabled = false; 196 | downButton.Enabled = false; 197 | deleteButton.Enabled = false; 198 | } 199 | else 200 | { 201 | deleteButton.Enabled = true; 202 | if (groupList.SelectedIndex > 0) 203 | upButton.Enabled = true; 204 | else 205 | upButton.Enabled = false; 206 | if (groupList.SelectedIndex < groupList.Items.Count - 1) 207 | downButton.Enabled = true; 208 | else 209 | downButton.Enabled = false; 210 | } 211 | } 212 | 213 | private void CreateButton_Click(object sender, EventArgs e) 214 | { 215 | if (layerList.SelectedIndex == -1 || 216 | layerList.Items.Contains("(none)")) 217 | { 218 | groups.Add(new List()); 219 | groupList.Items.Add($"Group {count++}"); 220 | } 221 | else 222 | { 223 | groups[groupList.SelectedIndex].Add(new Layer() 224 | { 225 | name = "(none)", 226 | layerId = -1 227 | }); 228 | layerList.Items.Add("(none)"); 229 | } 230 | } 231 | 232 | private void LayerList_SelectedIndexChanged(object sender, EventArgs e) 233 | { 234 | CheckSelected(); 235 | } 236 | 237 | private void DeleteButton_Click(object sender, EventArgs e) 238 | { 239 | if (layerList.SelectedIndex == -1) 240 | { 241 | if (groupList.SelectedIndex != -1) 242 | { 243 | groups.RemoveAt(groupList.SelectedIndex); 244 | groupList.Items.RemoveAt(groupList.SelectedIndex); 245 | } 246 | } 247 | else 248 | { 249 | groups[groupList.SelectedIndex].RemoveAt(layerList.SelectedIndex); 250 | layerList.Items.RemoveAt(layerList.SelectedIndex); 251 | } 252 | } 253 | 254 | private void GroupList_KeyPress(object sender, KeyPressEventArgs e) 255 | { 256 | if (groupList.SelectedIndex != -1 && e.KeyChar == '\b') 257 | { 258 | groups.RemoveAt(groupList.SelectedIndex); 259 | groupList.Items.RemoveAt(groupList.SelectedIndex); 260 | } 261 | } 262 | 263 | private void LayerList_KeyPress(object sender, KeyPressEventArgs e) 264 | { 265 | if (layerList.SelectedIndex != -1 && e.KeyChar == '\b') 266 | { 267 | groups[groupList.SelectedIndex].RemoveAt(layerList.SelectedIndex); 268 | layerList.Items.RemoveAt(layerList.SelectedIndex); 269 | } 270 | } 271 | 272 | private void GroupList_SelectedIndexChanged(object sender, EventArgs e) 273 | { 274 | layerList.Items.Clear(); 275 | if (groupList.SelectedIndex != -1) 276 | foreach (Layer layer in groups[groupList.SelectedIndex]) 277 | layerList.Items.Add(layer.name); 278 | CheckAddButton(); 279 | CheckSelected(); 280 | } 281 | 282 | private void MoveSelected(int index, bool isUp) 283 | { 284 | List group = groups[index]; 285 | string item = groupList.Items[index].ToString(); 286 | groups.RemoveAt(index); 287 | groupList.Enabled = false; 288 | groupList.Items.RemoveAt(index); 289 | if (isUp) 290 | index--; 291 | else 292 | index++; 293 | groupList.Enabled = true; 294 | groups.Insert(index, group); 295 | groupList.Items.Insert(index, item); 296 | groupList.SelectedIndex = index; 297 | } 298 | 299 | private void UpButton_Click(object sender, EventArgs e) 300 | { 301 | MoveSelected(groupList.SelectedIndex, true); 302 | } 303 | 304 | private void DownButton_Click(object sender, EventArgs e) 305 | { 306 | MoveSelected(groupList.SelectedIndex, false); 307 | } 308 | 309 | private void GroupBox_SelectedIndexChanged(object sender, EventArgs e) 310 | { 311 | SetLayerBox(layerBox, groupBox.SelectedIndex); 312 | CheckAddGroupButton(); 313 | addButton.Enabled = false; 314 | } 315 | 316 | private void LayerBox_DrawItem(object sender, DrawItemEventArgs e) 317 | { 318 | DrawItem(layerBox, groupBox, e); 319 | } 320 | 321 | private void LayerBox_SelectedIndexChanged(object sender, EventArgs e) 322 | { 323 | CheckAddButton(); 324 | } 325 | 326 | private void CheckAddButton() 327 | { 328 | if (layerBox.SelectedIndex != -1 && 329 | groupList.SelectedIndex != -1 && 330 | !layerList.Items.Contains(layerBox.SelectedItem)) 331 | addButton.Enabled = true; 332 | else 333 | addButton.Enabled = false; 334 | } 335 | 336 | private void AddButton_Click(object sender, EventArgs e) 337 | { 338 | groups[groupList.SelectedIndex].Add(GetLayer(groupBox.SelectedIndex, 339 | layerBox.SelectedIndex)); 340 | layerList.Items.Add(layerBox.SelectedItem); 341 | } 342 | 343 | private void AddGroupButton_Click(object sender, EventArgs e) 344 | { 345 | groups.Add(new List()); 346 | for (int i = 0; i < layerBox.Items.Count; i++) 347 | groups[groups.Count - 1].Add(GetLayer(groupBox.SelectedIndex, i)); 348 | groupList.Items.Add(groupBox.SelectedItem); 349 | } 350 | } 351 | } 352 | -------------------------------------------------------------------------------- /krkrFgiEditor/BatchWin.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 | 121 | 17, 17 122 | 123 | 124 | 125 | 126 | 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 159 | 160 | 161 | -------------------------------------------------------------------------------- /krkrFgiEditor/ComboBoxEx.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace krkrFgiEditor 2 | { 3 | partial class ComboBoxEx 4 | { 5 | /// 6 | /// 必需的设计器变量。 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 清理所有正在使用的资源。 12 | /// 13 | /// 如果应释放托管资源,为 true;否则为 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 组件设计器生成的代码 24 | 25 | /// 26 | /// 设计器支持所需的方法 - 不要修改 27 | /// 使用代码编辑器修改此方法的内容。 28 | /// 29 | private void InitializeComponent() 30 | { 31 | components = new System.ComponentModel.Container(); 32 | } 33 | 34 | #endregion 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /krkrFgiEditor/ComboBoxEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Security.Permissions; 4 | using System.Windows.Forms; 5 | 6 | namespace krkrFgiEditor 7 | { 8 | public partial class ComboBoxEx : ComboBox 9 | { 10 | private static readonly object EVENT_HOVEREDINDEXCHANGED = new object(); 11 | 12 | private int hoveredIndex = -1; 13 | 14 | [Browsable(false)] 15 | [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] 16 | public int HoveredIndex 17 | { 18 | get 19 | { 20 | return hoveredIndex; 21 | } 22 | private set 23 | { 24 | if (HoveredIndex != value) 25 | { 26 | hoveredIndex = value; 27 | OnHoveredIndexChanged(EventArgs.Empty); 28 | } 29 | } 30 | } 31 | 32 | public event EventHandler HoveredIndexChanged 33 | { 34 | add 35 | { 36 | Events.AddHandler(EVENT_HOVEREDINDEXCHANGED, value); 37 | } 38 | remove 39 | { 40 | Events.RemoveHandler(EVENT_HOVEREDINDEXCHANGED, value); 41 | } 42 | } 43 | 44 | public ComboBoxEx() { } 45 | 46 | protected virtual void OnHoveredIndexChanged(EventArgs e) 47 | { 48 | ((EventHandler)Events[EVENT_HOVEREDINDEXCHANGED])?.Invoke(this, e); 49 | } 50 | [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] 51 | protected override void WndProc(ref Message m) 52 | { 53 | base.WndProc(ref m); 54 | switch (m.Msg) 55 | { 56 | case 327: 57 | HoveredIndex = m.Result.ToInt32(); 58 | break; 59 | case 8465: 60 | if (m.WParam.ToInt32() >> 16 == 8) 61 | HoveredIndex = -1; 62 | break; 63 | } 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /krkrFgiEditor/ListBoxEx.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace krkrFgiEditor 2 | { 3 | partial class ListBoxEx 4 | { 5 | /// 6 | /// 必需的设计器变量。 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 清理所有正在使用的资源。 12 | /// 13 | /// 如果应释放托管资源,为 true;否则为 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 组件设计器生成的代码 24 | 25 | /// 26 | /// 设计器支持所需的方法 - 不要修改 27 | /// 使用代码编辑器修改此方法的内容。 28 | /// 29 | private void InitializeComponent() 30 | { 31 | components = new System.ComponentModel.Container(); 32 | } 33 | 34 | #endregion 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /krkrFgiEditor/ListBoxEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Permissions; 3 | using System.Windows.Forms; 4 | 5 | namespace krkrFgiEditor 6 | { 7 | public partial class ListBoxEx : ListBox 8 | { 9 | private static readonly object EVENT_ITEMSCHANGED = new object(); 10 | 11 | public event EventHandler ItemsChanged 12 | { 13 | add 14 | { 15 | Events.AddHandler(EVENT_ITEMSCHANGED, value); 16 | } 17 | remove 18 | { 19 | Events.RemoveHandler(EVENT_ITEMSCHANGED, value); 20 | } 21 | } 22 | 23 | public ListBoxEx() { } 24 | 25 | protected virtual void OnItemsChanged(EventArgs e) 26 | { 27 | ((EventHandler)Events[EVENT_ITEMSCHANGED])?.Invoke(this, e); 28 | } 29 | [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] 30 | protected override void WndProc(ref Message m) 31 | { 32 | base.WndProc(ref m); 33 | switch (m.Msg) 34 | { 35 | case 384: 36 | case 385: 37 | case 386: 38 | case 388: 39 | OnItemsChanged(EventArgs.Empty); 40 | break; 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /krkrFgiEditor/MainWin.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace krkrFgiEditor 2 | { 3 | partial class MainWin 4 | { 5 | /// 6 | /// 必需的设计器变量。 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 清理所有正在使用的资源。 12 | /// 13 | /// 如果应释放托管资源,为 true;否则为 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 窗体设计器生成的代码 24 | 25 | /// 26 | /// 设计器支持所需的方法 - 不要修改 27 | /// 使用代码编辑器修改此方法的内容。 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWin)); 33 | this.openFile = new System.Windows.Forms.Button(); 34 | this.fgiBox = new System.Windows.Forms.PictureBox(); 35 | this.filePath = new System.Windows.Forms.TextBox(); 36 | this.openPanel = new System.Windows.Forms.GroupBox(); 37 | this.encodingLabel = new System.Windows.Forms.Label(); 38 | this.encodingBox = new System.Windows.Forms.ComboBox(); 39 | this.detectEncoding = new System.Windows.Forms.Button(); 40 | this.layerPanel = new System.Windows.Forms.GroupBox(); 41 | this.autoSort = new System.Windows.Forms.CheckBox(); 42 | this.selectedLabel = new System.Windows.Forms.Label(); 43 | this.cancelButton = new System.Windows.Forms.Button(); 44 | this.downButton = new System.Windows.Forms.Button(); 45 | this.upButton = new System.Windows.Forms.Button(); 46 | this.deleteButton = new System.Windows.Forms.Button(); 47 | this.addButton = new System.Windows.Forms.Button(); 48 | this.selectedBox = new krkrFgiEditor.ListBoxEx(); 49 | this.layerBox = new krkrFgiEditor.ComboBoxEx(); 50 | this.layerLabel = new System.Windows.Forms.Label(); 51 | this.groupBox = new System.Windows.Forms.ComboBox(); 52 | this.groupLabel = new System.Windows.Forms.Label(); 53 | this.batchButton = new System.Windows.Forms.Button(); 54 | this.saveButton = new System.Windows.Forms.Button(); 55 | this.selectedBoxTip = new System.Windows.Forms.ToolTip(this.components); 56 | this.savePanel = new System.Windows.Forms.Panel(); 57 | this.fgiBoxTip = new System.Windows.Forms.ToolTip(this.components); 58 | ((System.ComponentModel.ISupportInitialize)(this.fgiBox)).BeginInit(); 59 | this.openPanel.SuspendLayout(); 60 | this.layerPanel.SuspendLayout(); 61 | this.savePanel.SuspendLayout(); 62 | this.SuspendLayout(); 63 | // 64 | // openFile 65 | // 66 | this.openFile.Location = new System.Drawing.Point(6, 30); 67 | this.openFile.Name = "openFile"; 68 | this.openFile.Size = new System.Drawing.Size(120, 35); 69 | this.openFile.TabIndex = 0; 70 | this.openFile.Text = "打开文件"; 71 | this.openFile.UseVisualStyleBackColor = true; 72 | this.openFile.Click += new System.EventHandler(this.OpenFile_Click); 73 | // 74 | // fgiBox 75 | // 76 | this.fgiBox.BackColor = System.Drawing.SystemColors.Control; 77 | this.fgiBox.Enabled = false; 78 | this.fgiBox.Location = new System.Drawing.Point(500, 12); 79 | this.fgiBox.Name = "fgiBox"; 80 | this.fgiBox.Size = new System.Drawing.Size(385, 544); 81 | this.fgiBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; 82 | this.fgiBox.TabIndex = 1; 83 | this.fgiBox.TabStop = false; 84 | this.fgiBox.Click += new System.EventHandler(this.FgiBox_Click); 85 | // 86 | // filePath 87 | // 88 | this.filePath.Location = new System.Drawing.Point(132, 32); 89 | this.filePath.Name = "filePath"; 90 | this.filePath.Size = new System.Drawing.Size(335, 31); 91 | this.filePath.TabIndex = 1; 92 | this.filePath.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.FilePath_KeyPress); 93 | // 94 | // openPanel 95 | // 96 | this.openPanel.Controls.Add(this.encodingLabel); 97 | this.openPanel.Controls.Add(this.encodingBox); 98 | this.openPanel.Controls.Add(this.detectEncoding); 99 | this.openPanel.Controls.Add(this.filePath); 100 | this.openPanel.Controls.Add(this.openFile); 101 | this.openPanel.Location = new System.Drawing.Point(12, 12); 102 | this.openPanel.Name = "openPanel"; 103 | this.openPanel.Size = new System.Drawing.Size(473, 122); 104 | this.openPanel.TabIndex = 0; 105 | this.openPanel.TabStop = false; 106 | this.openPanel.Text = "坐标文件"; 107 | // 108 | // encodingLabel 109 | // 110 | this.encodingLabel.AutoSize = true; 111 | this.encodingLabel.Enabled = false; 112 | this.encodingLabel.Location = new System.Drawing.Point(25, 74); 113 | this.encodingLabel.Name = "encodingLabel"; 114 | this.encodingLabel.Size = new System.Drawing.Size(82, 24); 115 | this.encodingLabel.TabIndex = 2; 116 | this.encodingLabel.Text = "编码格式"; 117 | // 118 | // encodingBox 119 | // 120 | this.encodingBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 121 | this.encodingBox.Enabled = false; 122 | this.encodingBox.FormattingEnabled = true; 123 | this.encodingBox.Items.AddRange(new object[] { 124 | "Shift JIS", 125 | "UTF-8", 126 | "UTF-16 LE"}); 127 | this.encodingBox.Location = new System.Drawing.Point(132, 70); 128 | this.encodingBox.Name = "encodingBox"; 129 | this.encodingBox.Size = new System.Drawing.Size(209, 32); 130 | this.encodingBox.TabIndex = 3; 131 | this.encodingBox.SelectedIndexChanged += new System.EventHandler(this.EncodingBox_SelectedIndexChanged); 132 | // 133 | // detectEncoding 134 | // 135 | this.detectEncoding.Enabled = false; 136 | this.detectEncoding.Location = new System.Drawing.Point(347, 69); 137 | this.detectEncoding.Name = "detectEncoding"; 138 | this.detectEncoding.Size = new System.Drawing.Size(120, 35); 139 | this.detectEncoding.TabIndex = 4; 140 | this.detectEncoding.Text = "自动检测"; 141 | this.detectEncoding.UseVisualStyleBackColor = true; 142 | this.detectEncoding.Click += new System.EventHandler(this.DetectEncoding_Click); 143 | // 144 | // layerPanel 145 | // 146 | this.layerPanel.Controls.Add(this.autoSort); 147 | this.layerPanel.Controls.Add(this.selectedLabel); 148 | this.layerPanel.Controls.Add(this.cancelButton); 149 | this.layerPanel.Controls.Add(this.downButton); 150 | this.layerPanel.Controls.Add(this.upButton); 151 | this.layerPanel.Controls.Add(this.deleteButton); 152 | this.layerPanel.Controls.Add(this.addButton); 153 | this.layerPanel.Controls.Add(this.selectedBox); 154 | this.layerPanel.Controls.Add(this.layerBox); 155 | this.layerPanel.Controls.Add(this.layerLabel); 156 | this.layerPanel.Controls.Add(this.groupBox); 157 | this.layerPanel.Controls.Add(this.groupLabel); 158 | this.layerPanel.Enabled = false; 159 | this.layerPanel.Location = new System.Drawing.Point(12, 140); 160 | this.layerPanel.Name = "layerPanel"; 161 | this.layerPanel.Size = new System.Drawing.Size(473, 364); 162 | this.layerPanel.TabIndex = 1; 163 | this.layerPanel.TabStop = false; 164 | this.layerPanel.Text = "图层选择"; 165 | // 166 | // autoSort 167 | // 168 | this.autoSort.AutoSize = true; 169 | this.autoSort.Checked = true; 170 | this.autoSort.CheckState = System.Windows.Forms.CheckState.Checked; 171 | this.autoSort.Location = new System.Drawing.Point(132, 110); 172 | this.autoSort.Name = "autoSort"; 173 | this.autoSort.Size = new System.Drawing.Size(108, 28); 174 | this.autoSort.TabIndex = 4; 175 | this.autoSort.Text = "自动排序"; 176 | this.autoSort.UseVisualStyleBackColor = true; 177 | this.autoSort.CheckedChanged += new System.EventHandler(this.AutoSort_CheckedChanged); 178 | // 179 | // selectedLabel 180 | // 181 | this.selectedLabel.AutoSize = true; 182 | this.selectedLabel.Location = new System.Drawing.Point(25, 210); 183 | this.selectedLabel.Name = "selectedLabel"; 184 | this.selectedLabel.Size = new System.Drawing.Size(82, 24); 185 | this.selectedLabel.TabIndex = 7; 186 | this.selectedLabel.Text = "当前图层"; 187 | // 188 | // cancelButton 189 | // 190 | this.cancelButton.Enabled = false; 191 | this.cancelButton.Location = new System.Drawing.Point(249, 107); 192 | this.cancelButton.Name = "cancelButton"; 193 | this.cancelButton.Size = new System.Drawing.Size(100, 35); 194 | this.cancelButton.TabIndex = 5; 195 | this.cancelButton.Text = "取消"; 196 | this.cancelButton.UseVisualStyleBackColor = true; 197 | this.cancelButton.Click += new System.EventHandler(this.CancelButton_Click); 198 | // 199 | // downButton 200 | // 201 | this.downButton.Enabled = false; 202 | this.downButton.Location = new System.Drawing.Point(249, 308); 203 | this.downButton.Name = "downButton"; 204 | this.downButton.Size = new System.Drawing.Size(100, 35); 205 | this.downButton.TabIndex = 10; 206 | this.downButton.Text = "下移"; 207 | this.downButton.UseVisualStyleBackColor = true; 208 | this.downButton.Click += new System.EventHandler(this.DownButton_Click); 209 | // 210 | // upButton 211 | // 212 | this.upButton.Enabled = false; 213 | this.upButton.Location = new System.Drawing.Point(132, 308); 214 | this.upButton.Name = "upButton"; 215 | this.upButton.Size = new System.Drawing.Size(100, 35); 216 | this.upButton.TabIndex = 9; 217 | this.upButton.Text = "上移"; 218 | this.upButton.UseVisualStyleBackColor = true; 219 | this.upButton.Click += new System.EventHandler(this.UpButton_Click); 220 | // 221 | // deleteButton 222 | // 223 | this.deleteButton.Enabled = false; 224 | this.deleteButton.Location = new System.Drawing.Point(367, 308); 225 | this.deleteButton.Name = "deleteButton"; 226 | this.deleteButton.Size = new System.Drawing.Size(100, 35); 227 | this.deleteButton.TabIndex = 11; 228 | this.deleteButton.Text = "删除"; 229 | this.deleteButton.UseVisualStyleBackColor = true; 230 | this.deleteButton.Click += new System.EventHandler(this.DeleteButton_Click); 231 | // 232 | // addButton 233 | // 234 | this.addButton.Enabled = false; 235 | this.addButton.Location = new System.Drawing.Point(367, 107); 236 | this.addButton.Name = "addButton"; 237 | this.addButton.Size = new System.Drawing.Size(100, 35); 238 | this.addButton.TabIndex = 6; 239 | this.addButton.Text = "添加"; 240 | this.addButton.UseVisualStyleBackColor = true; 241 | this.addButton.Click += new System.EventHandler(this.AddButton_Click); 242 | // 243 | // selectedBox 244 | // 245 | this.selectedBox.AllowDrop = true; 246 | this.selectedBox.Font = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); 247 | this.selectedBox.FormattingEnabled = true; 248 | this.selectedBox.ItemHeight = 25; 249 | this.selectedBox.Location = new System.Drawing.Point(132, 148); 250 | this.selectedBox.Name = "selectedBox"; 251 | this.selectedBox.Size = new System.Drawing.Size(335, 154); 252 | this.selectedBox.TabIndex = 8; 253 | this.selectedBox.ItemsChanged += new System.EventHandler(this.SelectedBox_ItemsChanged); 254 | this.selectedBox.SelectedIndexChanged += new System.EventHandler(this.SelectedBox_SelectedIndexChanged); 255 | this.selectedBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.SelectedBox_KeyPress); 256 | // 257 | // layerBox 258 | // 259 | this.layerBox.BackColor = System.Drawing.SystemColors.Window; 260 | this.layerBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; 261 | this.layerBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 262 | this.layerBox.Font = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); 263 | this.layerBox.Location = new System.Drawing.Point(132, 69); 264 | this.layerBox.MaxDropDownItems = 40; 265 | this.layerBox.Name = "layerBox"; 266 | this.layerBox.Size = new System.Drawing.Size(335, 32); 267 | this.layerBox.TabIndex = 3; 268 | this.layerBox.HoveredIndexChanged += new System.EventHandler(this.Layer_HoveredIndexChanged); 269 | this.layerBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.LayerBox_DrawItem); 270 | this.layerBox.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.LayerBox_MeasureItem); 271 | this.layerBox.SelectedIndexChanged += new System.EventHandler(this.LayerBox_SelectedIndexChanged); 272 | // 273 | // layerLabel 274 | // 275 | this.layerLabel.AutoSize = true; 276 | this.layerLabel.Location = new System.Drawing.Point(43, 73); 277 | this.layerLabel.Name = "layerLabel"; 278 | this.layerLabel.Size = new System.Drawing.Size(46, 24); 279 | this.layerLabel.TabIndex = 2; 280 | this.layerLabel.Text = "图层"; 281 | // 282 | // groupBox 283 | // 284 | this.groupBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 285 | this.groupBox.Font = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); 286 | this.groupBox.FormattingEnabled = true; 287 | this.groupBox.Location = new System.Drawing.Point(132, 31); 288 | this.groupBox.Name = "groupBox"; 289 | this.groupBox.Size = new System.Drawing.Size(335, 33); 290 | this.groupBox.TabIndex = 1; 291 | this.groupBox.SelectedIndexChanged += new System.EventHandler(this.GroupBox_SelectedIndexChanged); 292 | // 293 | // groupLabel 294 | // 295 | this.groupLabel.AutoSize = true; 296 | this.groupLabel.Location = new System.Drawing.Point(34, 35); 297 | this.groupLabel.Name = "groupLabel"; 298 | this.groupLabel.Size = new System.Drawing.Size(64, 24); 299 | this.groupLabel.TabIndex = 0; 300 | this.groupLabel.Text = "图层组"; 301 | // 302 | // batchButton 303 | // 304 | this.batchButton.Enabled = false; 305 | this.batchButton.Location = new System.Drawing.Point(209, 3); 306 | this.batchButton.Name = "batchButton"; 307 | this.batchButton.Size = new System.Drawing.Size(150, 35); 308 | this.batchButton.TabIndex = 1; 309 | this.batchButton.Text = "批量合成"; 310 | this.batchButton.UseVisualStyleBackColor = true; 311 | this.batchButton.Click += new System.EventHandler(this.BatchButton_Click); 312 | // 313 | // saveButton 314 | // 315 | this.saveButton.Enabled = false; 316 | this.saveButton.Location = new System.Drawing.Point(3, 3); 317 | this.saveButton.Name = "saveButton"; 318 | this.saveButton.Size = new System.Drawing.Size(150, 35); 319 | this.saveButton.TabIndex = 0; 320 | this.saveButton.Text = "保存结果"; 321 | this.saveButton.UseVisualStyleBackColor = true; 322 | this.saveButton.Click += new System.EventHandler(this.SaveButton_Click); 323 | // 324 | // savePanel 325 | // 326 | this.savePanel.Controls.Add(this.saveButton); 327 | this.savePanel.Controls.Add(this.batchButton); 328 | this.savePanel.Location = new System.Drawing.Point(67, 518); 329 | this.savePanel.Name = "savePanel"; 330 | this.savePanel.Size = new System.Drawing.Size(362, 41); 331 | this.savePanel.TabIndex = 2; 332 | // 333 | // MainWin 334 | // 335 | this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F); 336 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 337 | this.ClientSize = new System.Drawing.Size(897, 574); 338 | this.Controls.Add(this.savePanel); 339 | this.Controls.Add(this.layerPanel); 340 | this.Controls.Add(this.openPanel); 341 | this.Controls.Add(this.fgiBox); 342 | this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 343 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 344 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 345 | this.Margin = new System.Windows.Forms.Padding(4); 346 | this.MaximizeBox = false; 347 | this.Name = "MainWin"; 348 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 349 | this.Text = "krkrFgiEditor"; 350 | ((System.ComponentModel.ISupportInitialize)(this.fgiBox)).EndInit(); 351 | this.openPanel.ResumeLayout(false); 352 | this.openPanel.PerformLayout(); 353 | this.layerPanel.ResumeLayout(false); 354 | this.layerPanel.PerformLayout(); 355 | this.savePanel.ResumeLayout(false); 356 | this.ResumeLayout(false); 357 | 358 | } 359 | 360 | #endregion 361 | 362 | private System.Windows.Forms.Button openFile; 363 | private System.Windows.Forms.PictureBox fgiBox; 364 | private System.Windows.Forms.TextBox filePath; 365 | private System.Windows.Forms.GroupBox openPanel; 366 | private System.Windows.Forms.GroupBox layerPanel; 367 | private System.Windows.Forms.Label groupLabel; 368 | private ComboBoxEx layerBox; 369 | private System.Windows.Forms.Label layerLabel; 370 | private System.Windows.Forms.ComboBox groupBox; 371 | private ListBoxEx selectedBox; 372 | private System.Windows.Forms.Button batchButton; 373 | private System.Windows.Forms.Button saveButton; 374 | private System.Windows.Forms.ToolTip selectedBoxTip; 375 | private System.Windows.Forms.Panel savePanel; 376 | private System.Windows.Forms.Label encodingLabel; 377 | private System.Windows.Forms.ComboBox encodingBox; 378 | private System.Windows.Forms.Button detectEncoding; 379 | private System.Windows.Forms.Button addButton; 380 | private System.Windows.Forms.Button cancelButton; 381 | private System.Windows.Forms.Button downButton; 382 | private System.Windows.Forms.Button upButton; 383 | private System.Windows.Forms.Label selectedLabel; 384 | private System.Windows.Forms.ToolTip fgiBoxTip; 385 | private System.Windows.Forms.CheckBox autoSort; 386 | private System.Windows.Forms.Button deleteButton; 387 | } 388 | } 389 | 390 | -------------------------------------------------------------------------------- /krkrFgiEditor/MainWin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Text.RegularExpressions; 8 | using System.Windows.Forms; 9 | 10 | namespace krkrFgiEditor 11 | { 12 | public partial class MainWin : Form 13 | { 14 | public MainWin() 15 | { 16 | InitializeComponent(); 17 | encodings = new Encoding[] 18 | { 19 | Encoding.GetEncoding(932), 20 | Encoding.UTF8, 21 | Encoding.Unicode, 22 | }; 23 | selectedBoxTip.SetToolTip(selectedBox, "按backspace删除当前项"); 24 | fgiBoxTip.SetToolTip(fgiBox, "点击查看大图"); 25 | groupLayers = new List(); 26 | selectedLayers = new List(); 27 | layerAlphas = new Dictionary(); 28 | } 29 | 30 | private Image resultImage; 31 | 32 | private readonly Encoding[] encodings; 33 | private readonly List groupLayers; 34 | private readonly List selectedLayers; 35 | private Image ResultImage 36 | { 37 | get 38 | { 39 | return resultImage; 40 | } 41 | set 42 | { 43 | if (resultImage != null) 44 | resultImage.Dispose(); 45 | resultImage = value; 46 | } 47 | } 48 | private string character; 49 | private readonly Dictionary layerAlphas; 50 | 51 | private void OpenFile_Click(object sender, EventArgs e) 52 | { 53 | OpenFileDialog ofd = new OpenFileDialog 54 | { 55 | Filter = "文本文件|*.txt;*.json" 56 | }; 57 | if (ofd.ShowDialog() == DialogResult.OK) 58 | Initialize(filePath.Text = ofd.FileName); 59 | ofd.Dispose(); 60 | } 61 | 62 | private void FilePath_KeyPress(object sender, KeyPressEventArgs e) 63 | { 64 | if (e.KeyChar == '\r') 65 | if (!File.Exists(filePath.Text)) 66 | MessageBox.Show("文件不存在!", "", 67 | MessageBoxButtons.OK, MessageBoxIcon.Error); 68 | else 69 | Initialize(filePath.Text); 70 | } 71 | 72 | private void ClearAll() 73 | { 74 | encodingLabel.Enabled = false; 75 | encodingBox.Enabled = false; 76 | encodingBox.DropDownStyle = ComboBoxStyle.DropDownList; 77 | detectEncoding.Enabled = false; 78 | layerPanel.Enabled = false; 79 | saveButton.Enabled = false; 80 | batchButton.Enabled = false; 81 | fgiBox.Image = null; 82 | ResultImage = null; 83 | groupBox.Items.Clear(); 84 | layerBox.Items.Clear(); 85 | layerAlphas.Clear(); 86 | selectedLayers.Clear(); 87 | selectedBox.Items.Clear(); 88 | groupLayers.Clear(); 89 | groupLayers.Add(new GroupLayer 90 | { 91 | name = "(none)", 92 | groupLayerId = -1, 93 | layers = new List() 94 | }); 95 | GC.Collect(); 96 | } 97 | 98 | private void Initialize(string path) 99 | { 100 | encodingBox.SelectedIndex = -1; 101 | if (Path.GetExtension(path) == ".json") 102 | JSONInitialize(path); 103 | else 104 | encodingBox.SelectedIndex = DetectEncoding(path); 105 | } 106 | 107 | private void TXTInitialize(string path, Encoding encoding) 108 | { 109 | ClearAll(); 110 | DirectoryInfo dir = new DirectoryInfo(Path.GetDirectoryName(path)); 111 | character = Path.GetFileNameWithoutExtension(path); 112 | List errorImages = new List(); 113 | using (StreamReader sr = new StreamReader(path, encoding)) 114 | { 115 | foreach (string line in Regex.Split(sr.ReadToEnd(), "\r\n")) 116 | { 117 | string[] attrs = line.Split('\t'); 118 | if (attrs[0] == "0") 119 | { 120 | FileInfo[] infos = dir.GetFiles($"{character}_{attrs[9]}.*"); 121 | try 122 | { 123 | if (!string.IsNullOrEmpty(attrs[10])) 124 | { 125 | int groupLayerId = int.Parse(attrs[10]); 126 | if (!HasGroupLayerId(groupLayerId, out int index)) 127 | groupLayers.Add(new GroupLayer 128 | { 129 | groupLayerId = groupLayerId, 130 | layers = new List() 131 | }); 132 | groupLayers[index].layers.Add(new Layer 133 | { 134 | name = attrs[1], 135 | left = int.Parse(attrs[2]), 136 | top = int.Parse(attrs[3]), 137 | opacity = byte.Parse(attrs[7]), 138 | layerId = int.Parse(attrs[9]), 139 | Image = Image.FromFile(infos[0].FullName) 140 | }); 141 | } 142 | else 143 | groupLayers[0].layers.Add(new Layer 144 | { 145 | name = attrs[1], 146 | left = int.Parse(attrs[2]), 147 | top = int.Parse(attrs[3]), 148 | opacity = byte.Parse(attrs[7]), 149 | layerId = int.Parse(attrs[9]), 150 | Image = Image.FromFile(infos[0].FullName) 151 | }); 152 | } 153 | catch (IndexOutOfRangeException) 154 | { 155 | errorImages.Add(attrs[9]); 156 | continue; 157 | } 158 | } 159 | else if (attrs[0] == "2") 160 | if (HasGroupLayerId(int.Parse(attrs[9]), out int index)) 161 | groupLayers[index].name = attrs[1]; 162 | } 163 | } 164 | if (errorImages.Count > 0) 165 | { 166 | string message = "图片读取失败:"; 167 | foreach (string layerId in errorImages) 168 | message += $"{character}_{layerId}、"; 169 | message = message.Substring(0, message.Length - 1); 170 | MessageBox.Show(message, "", 171 | MessageBoxButtons.OK, MessageBoxIcon.Warning); 172 | } 173 | encodingLabel.Enabled = true; 174 | encodingBox.Enabled = true; 175 | detectEncoding.Enabled = true; 176 | if (IsEmpty(groupLayers)) 177 | { 178 | MessageBox.Show("加载失败!", "", 179 | MessageBoxButtons.OK, MessageBoxIcon.Error); 180 | return; 181 | } 182 | InitializeGroupBox(groupBox); 183 | layerPanel.Enabled = true; 184 | batchButton.Enabled = true; 185 | } 186 | 187 | private void JSONInitialize(string path) 188 | { 189 | ClearAll(); 190 | DirectoryInfo dir = new DirectoryInfo(Path.GetDirectoryName(path)); 191 | character = Path.GetFileNameWithoutExtension(path); 192 | character = Path.GetFileNameWithoutExtension(character); 193 | List errorImages = new List(); 194 | string json = File.ReadAllText(path); 195 | MatchCollection matches = Regex.Matches(json, 196 | "{(?:\\s*\"(?:(?:\\\\.)|[^\\\\\"])*\"\\s*:\\s*(?:\"(?:(?:\\\\.)|[^\\\\\"])*\"|\\d+)\\s*,?\\s*)*}"); 197 | List> items = new List>(); 198 | for (int i = 0; i < matches.Count; i++) 199 | { 200 | items.Add(new Dictionary()); 201 | MatchCollection pairs = Regex.Matches(matches[i].Value, 202 | "\"((?:(?:\\\\.)|[^\\\\\"])*)\"\\s*:\\s*(\"(?:(?:\\\\.)|[^\\\\\"])*\"|\\d+)"); 203 | foreach (Match pair in pairs) 204 | items[i].Add(pair.Groups[1].Value, pair.Groups[2].Value); 205 | } 206 | foreach (Dictionary item in items) 207 | { 208 | if (!item.ContainsKey("layer_type")) 209 | continue; 210 | int layerType = int.Parse(item["layer_type"]); 211 | if (layerType == 0) 212 | { 213 | FileInfo[] infos = dir.GetFiles($"{character}_{item["layer_id"]}.*"); 214 | try 215 | { 216 | if (item.ContainsKey("group_layer_id")) 217 | { 218 | int groupLayerId = int.Parse(item["group_layer_id"]); 219 | if (!HasGroupLayerId(groupLayerId, out int index)) 220 | groupLayers.Add(new GroupLayer 221 | { 222 | groupLayerId = groupLayerId, 223 | layers = new List() 224 | }); 225 | groupLayers[index].layers.Add(new Layer 226 | { 227 | name = GetTrueString(item["name"]), 228 | left = int.Parse(item["left"]), 229 | top = int.Parse(item["top"]), 230 | opacity = byte.Parse(item["opacity"]), 231 | layerId = int.Parse(item["layer_id"]), 232 | Image = Image.FromFile(infos[0].FullName) 233 | }); 234 | } 235 | else 236 | groupLayers[0].layers.Add(new Layer 237 | { 238 | name = GetTrueString(item["name"]), 239 | left = int.Parse(item["left"]), 240 | top = int.Parse(item["top"]), 241 | opacity = byte.Parse(item["opacity"]), 242 | layerId = int.Parse(item["layer_id"]), 243 | Image = Image.FromFile(infos[0].FullName) 244 | }); 245 | } 246 | catch (IndexOutOfRangeException) 247 | { 248 | errorImages.Add(item["layer_id"]); 249 | continue; 250 | } 251 | } 252 | else if (layerType == 2) 253 | if (HasGroupLayerId(int.Parse(item["layer_id"]), out int index)) 254 | groupLayers[index].name = GetTrueString(item["name"]); 255 | } 256 | if (errorImages.Count > 0) 257 | { 258 | string message = "图片读取失败:"; 259 | foreach (string layerId in errorImages) 260 | message += $"{character}_{layerId}、"; 261 | message = message.Substring(0, message.Length - 1); 262 | MessageBox.Show(message, "", 263 | MessageBoxButtons.OK, MessageBoxIcon.Warning); 264 | } 265 | encodingBox.DropDownStyle = ComboBoxStyle.DropDown; 266 | encodingBox.Text = "ASCII"; 267 | if (IsEmpty(groupLayers)) 268 | { 269 | MessageBox.Show("加载失败!", "", 270 | MessageBoxButtons.OK, MessageBoxIcon.Error); 271 | return; 272 | } 273 | InitializeGroupBox(groupBox); 274 | layerPanel.Enabled = true; 275 | batchButton.Enabled = true; 276 | } 277 | 278 | string GetTrueString(string str) 279 | { 280 | str = str.Substring(1, str.Length - 1); 281 | return Regex.Unescape(str); 282 | } 283 | 284 | private bool IsEmpty(List groupLayers) 285 | { 286 | foreach (GroupLayer groupLayer in groupLayers) 287 | if (groupLayer.layers.Count > 0) 288 | return false; 289 | return true; 290 | } 291 | 292 | private void InitializeGroupBox(ComboBox box) 293 | { 294 | foreach (GroupLayer groupLayer in groupLayers) 295 | box.Items.Add(groupLayer.name); 296 | box.SelectedIndex = 0; 297 | } 298 | 299 | private void Layer_HoveredIndexChanged(object sender, EventArgs e) 300 | { 301 | if (layerBox.HoveredIndex == -1 || 302 | selectedLayers.Contains(groupLayers[groupBox.SelectedIndex].layers[layerBox.HoveredIndex])) 303 | ShowFgi(ResultImage); 304 | else 305 | { 306 | List layers = new List(selectedLayers) 307 | { 308 | groupLayers[groupBox.SelectedIndex].layers[layerBox.HoveredIndex] 309 | }; 310 | if (autoSort.Checked) 311 | SortLayers(layers); 312 | Image tempImage = Layer.GenerateImage(layers); 313 | ShowFgi(tempImage); 314 | tempImage.Dispose(); 315 | } 316 | } 317 | 318 | private bool HasGroupLayerId(int groupLayerId, out int index) 319 | { 320 | for (index = 0; index < groupLayers.Count; index++) 321 | if (groupLayers[index].groupLayerId == groupLayerId) 322 | return true; 323 | return false; 324 | } 325 | 326 | private void SetLayerBox(ComboBox box, int index) 327 | { 328 | box.Items.Clear(); 329 | foreach (Layer layer in groupLayers[index].layers) 330 | box.Items.Add(layer.name); 331 | box.DropDownHeight = Math.Min(box.Items.Count, 10) * 100 + 2; 332 | box.SelectedIndex = -1; 333 | } 334 | 335 | private void LayerBox_DrawItem(object sender, DrawItemEventArgs e) 336 | { 337 | DrawItem(layerBox, groupBox, e); 338 | } 339 | 340 | private void DrawItem(ComboBox layerBox, ComboBox groupBox, DrawItemEventArgs e) 341 | { 342 | e.DrawBackground(); 343 | if (e.Index > -1) 344 | { 345 | if ((e.State & DrawItemState.ComboBoxEdit) != 0) 346 | e.Graphics.DrawString(layerBox.Items[e.Index].ToString(), 347 | e.Font, new SolidBrush(e.ForeColor), e.Bounds, 348 | StringFormat.GenericDefault); 349 | else 350 | { 351 | int height = layerBox.GetItemHeight(e.Index); 352 | int barWidth = layerBox.Items.Count > 10 ? SystemInformation.VerticalScrollBarWidth : 0; 353 | Image icon = Program.ResizeImage(groupLayers[groupBox.SelectedIndex].layers[e.Index].Image, 354 | height, height); 355 | e.Graphics.DrawImage(icon, e.Bounds.Left + (height - icon.Width) / 2, 356 | e.Bounds.Top + (height - icon.Height) / 2); 357 | e.Graphics.DrawString(layerBox.Items[e.Index].ToString(), 358 | e.Font, new SolidBrush(e.ForeColor), 359 | new Rectangle(e.Bounds.Left + height, e.Bounds.Top, 360 | layerBox.ClientSize.Width - height - barWidth, 361 | height), 362 | new StringFormat() 363 | { 364 | Alignment = StringAlignment.Center, 365 | LineAlignment = StringAlignment.Center 366 | }); 367 | icon.Dispose(); 368 | } 369 | } 370 | } 371 | 372 | private void LayerBox_MeasureItem(object sender, MeasureItemEventArgs e) 373 | { 374 | if (e.Index > -1) 375 | e.ItemHeight = 100; 376 | } 377 | 378 | private void LayerBox_SelectedIndexChanged(object sender, EventArgs e) 379 | { 380 | CheckAdd(); 381 | if (layerBox.SelectedIndex == -1) 382 | cancelButton.Enabled = false; 383 | else 384 | cancelButton.Enabled = true; 385 | } 386 | 387 | private void GroupBox_SelectedIndexChanged(object sender, EventArgs e) 388 | { 389 | SetLayerBox(layerBox, groupBox.SelectedIndex); 390 | } 391 | 392 | private void CancelButton_Click(object sender, EventArgs e) 393 | { 394 | layerBox.SelectedIndex = -1; 395 | ShowFgi(ResultImage); 396 | } 397 | 398 | private void AddButton_Click(object sender, EventArgs e) 399 | { 400 | selectedLayers.Add(groupLayers[groupBox.SelectedIndex].layers[layerBox.SelectedIndex]); 401 | if (autoSort.Checked) 402 | SortSelectedLayers(); 403 | else 404 | selectedBox.Items.Add(layerBox.SelectedItem); 405 | } 406 | 407 | private void SelectedBox_KeyPress(object sender, KeyPressEventArgs e) 408 | { 409 | if (selectedBox.SelectedIndex != -1 && e.KeyChar == '\b') 410 | { 411 | selectedLayers.RemoveAt(selectedBox.SelectedIndex); 412 | selectedBox.Items.RemoveAt(selectedBox.SelectedIndex); 413 | } 414 | } 415 | 416 | private void CheckAdd() 417 | { 418 | if (layerBox.SelectedIndex != -1 && 419 | !selectedBox.Items.Contains(layerBox.SelectedItem)) 420 | addButton.Enabled = true; 421 | else 422 | addButton.Enabled = false; 423 | } 424 | 425 | private void SelectedBox_SelectedIndexChanged(object sender, EventArgs e) 426 | { 427 | CheckSelected(); 428 | } 429 | 430 | private void CheckSelected() 431 | { 432 | if (selectedBox.SelectedIndex == -1) 433 | { 434 | upButton.Enabled = false; 435 | downButton.Enabled = false; 436 | deleteButton.Enabled = false; 437 | } 438 | else 439 | { 440 | deleteButton.Enabled = true; 441 | if (selectedBox.SelectedIndex > 0) 442 | upButton.Enabled = true; 443 | else 444 | upButton.Enabled = false; 445 | if (selectedBox.SelectedIndex < selectedBox.Items.Count - 1) 446 | downButton.Enabled = true; 447 | else 448 | downButton.Enabled = false; 449 | } 450 | } 451 | 452 | private void DeleteButton_Click(object sender, EventArgs e) 453 | { 454 | selectedLayers.RemoveAt(selectedBox.SelectedIndex); 455 | selectedBox.Items.RemoveAt(selectedBox.SelectedIndex); 456 | } 457 | 458 | private void SelectedBox_ItemsChanged(object sender, EventArgs e) 459 | { 460 | if (!selectedBox.Enabled) 461 | return; 462 | CheckAdd(); 463 | CheckSelected(); 464 | if (selectedBox.Items.Count > 0) 465 | { 466 | saveButton.Enabled = true; 467 | fgiBox.Enabled = true; 468 | } 469 | else 470 | { 471 | saveButton.Enabled = false; 472 | fgiBox.Enabled = false; 473 | } 474 | ResultImage = Layer.GenerateImage(selectedLayers); 475 | ShowFgi(ResultImage); 476 | } 477 | 478 | private void UpButton_Click(object sender, EventArgs e) 479 | { 480 | MoveSelected(selectedBox.SelectedIndex, true); 481 | } 482 | 483 | private void DownButton_Click(object sender, EventArgs e) 484 | { 485 | MoveSelected(selectedBox.SelectedIndex, false); 486 | } 487 | 488 | private void MoveSelected(int index, bool isUp) 489 | { 490 | Layer layer = selectedLayers[index]; 491 | string item = selectedBox.Items[index].ToString(); 492 | selectedLayers.RemoveAt(index); 493 | selectedBox.Enabled = false; 494 | selectedBox.Items.RemoveAt(index); 495 | if (isUp) 496 | index--; 497 | else 498 | index++; 499 | selectedBox.Enabled = true; 500 | selectedLayers.Insert(index, layer); 501 | selectedBox.Items.Insert(index, item); 502 | selectedBox.SelectedIndex = index; 503 | } 504 | 505 | private void ShowFgi(Image image) 506 | { 507 | if (image == null) 508 | fgiBox.Image = null; 509 | else 510 | fgiBox.Image = Program.ResizeImage(image, 511 | fgiBox.Width, fgiBox.Height); 512 | } 513 | 514 | private void FgiBox_Click(object sender, EventArgs e) 515 | { 516 | PictureWin pw = new PictureWin(ResultImage) 517 | { 518 | Text = GetResultName(selectedLayers) 519 | }; 520 | pw.ShowDialog(); 521 | pw.Dispose(); 522 | } 523 | 524 | private string GetResultName(List layers) 525 | { 526 | string name = character; 527 | foreach (Layer layer in layers) 528 | if (layer.Image != null) 529 | name += "_" + layer.layerId; 530 | return name; 531 | } 532 | 533 | private void SaveButton_Click(object sender, EventArgs e) 534 | { 535 | SaveFileDialog sfd = new SaveFileDialog 536 | { 537 | FileName = GetResultName(selectedLayers), 538 | Filter = "图片文件|*.png" 539 | }; 540 | if (sfd.ShowDialog() == DialogResult.OK) 541 | { 542 | ResultImage.Save(sfd.FileName); 543 | MessageBox.Show("保存成功!", "", 544 | MessageBoxButtons.OK, MessageBoxIcon.Information); 545 | } 546 | sfd.Dispose(); 547 | } 548 | 549 | private void EncodingBox_SelectedIndexChanged(object sender, EventArgs e) 550 | { 551 | if (encodingBox.SelectedIndex == -1) 552 | return; 553 | if (!File.Exists(filePath.Text)) 554 | { 555 | MessageBox.Show("文件不存在!", "", 556 | MessageBoxButtons.OK, MessageBoxIcon.Error); 557 | return; 558 | } 559 | TXTInitialize(filePath.Text, encodings[encodingBox.SelectedIndex]); 560 | } 561 | 562 | private int DetectEncoding(string path) 563 | { 564 | Dictionary errorChars = new Dictionary(); 565 | for (int i = 0; i < encodings.Length; i++) 566 | { 567 | errorChars.Add(i, 0); 568 | using (StreamReader sr = new StreamReader(path, encodings[i])) 569 | { 570 | foreach (char c in sr.ReadToEnd()) 571 | { 572 | int unicode = c; 573 | if (unicode < 0x0009 || 574 | unicode > 0x000a && unicode < 0x000d || 575 | unicode > 0x000d && unicode < 0x0020 || 576 | unicode > 0x007e && unicode < 0x3000 || 577 | unicode > 0x301f && unicode < 0x3041 || 578 | unicode > 0x30ff && unicode < 0x4e00 || 579 | unicode > 0x9fff && unicode < 0xff01 || 580 | unicode > 0xff9f) 581 | errorChars[i]++; 582 | } 583 | } 584 | } 585 | return errorChars.Aggregate((a, b) => a.Value < b.Value ? a : b).Key; 586 | } 587 | 588 | private void DetectEncoding_Click(object sender, EventArgs e) 589 | { 590 | if (!File.Exists(filePath.Text)) 591 | { 592 | MessageBox.Show("文件不存在!", "", 593 | MessageBoxButtons.OK, MessageBoxIcon.Error); 594 | return; 595 | } 596 | encodingBox.SelectedIndex = DetectEncoding(filePath.Text); 597 | } 598 | 599 | private void AutoSort_CheckedChanged(object sender, EventArgs e) 600 | { 601 | if (autoSort.Checked) 602 | SortSelectedLayers(); 603 | } 604 | 605 | private void SortSelectedLayers() 606 | { 607 | if (selectedLayers.Count == 0) 608 | return; 609 | SortLayers(selectedLayers); 610 | selectedBox.Enabled = false; 611 | selectedBox.Items.Clear(); 612 | for (int i = 0; i < selectedLayers.Count; i++) 613 | { 614 | if (i == selectedLayers.Count - 1) 615 | selectedBox.Enabled = true; 616 | selectedBox.Items.Add(selectedLayers[i].name); 617 | } 618 | } 619 | 620 | private void SortLayers(List layers) 621 | { 622 | foreach (Layer layer in layers) 623 | if (!layerAlphas.ContainsKey(layer.layerId)) 624 | layerAlphas.Add(layer.layerId, 625 | (int)((long)Program.AddAlphas(layer.Image) * layer.opacity / 255)); 626 | layers.Sort(new Comparison((Layer a, Layer b) 627 | => layerAlphas[b.layerId] - layerAlphas[a.layerId])); 628 | } 629 | 630 | private void BatchButton_Click(object sender, EventArgs e) 631 | { 632 | BatchWin bw = new BatchWin(InitializeGroupBox, 633 | SetLayerBox, LayerBox_MeasureItem, DrawItem, 634 | (i, j) => groupLayers[i].layers[j], GetResultName); 635 | bw.ShowDialog(); 636 | bw.Dispose(); 637 | } 638 | } 639 | } 640 | -------------------------------------------------------------------------------- /krkrFgiEditor/MainWin.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 | 121 | 17, 17 122 | 123 | 124 | 212, 17 125 | 126 | 127 | 128 | 129 | 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 162 | 163 | 164 | -------------------------------------------------------------------------------- /krkrFgiEditor/PictureWin.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace krkrFgiEditor 2 | { 3 | partial class PictureWin 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 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PictureWin)); 32 | this.fgiBox = new System.Windows.Forms.PictureBox(); 33 | ((System.ComponentModel.ISupportInitialize)(this.fgiBox)).BeginInit(); 34 | this.SuspendLayout(); 35 | // 36 | // fgiBox 37 | // 38 | this.fgiBox.Location = new System.Drawing.Point(12, 12); 39 | this.fgiBox.Name = "fgiBox"; 40 | this.fgiBox.Size = new System.Drawing.Size(554, 920); 41 | this.fgiBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; 42 | this.fgiBox.TabIndex = 0; 43 | this.fgiBox.TabStop = false; 44 | // 45 | // PictureWin 46 | // 47 | this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F); 48 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 49 | this.ClientSize = new System.Drawing.Size(578, 944); 50 | this.Controls.Add(this.fgiBox); 51 | this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 52 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 53 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 54 | this.Margin = new System.Windows.Forms.Padding(4); 55 | this.MaximizeBox = false; 56 | this.MinimizeBox = false; 57 | this.Name = "PictureWin"; 58 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 59 | ((System.ComponentModel.ISupportInitialize)(this.fgiBox)).EndInit(); 60 | this.ResumeLayout(false); 61 | 62 | } 63 | 64 | #endregion 65 | 66 | private System.Windows.Forms.PictureBox fgiBox; 67 | } 68 | } -------------------------------------------------------------------------------- /krkrFgiEditor/PictureWin.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Forms; 3 | 4 | namespace krkrFgiEditor 5 | { 6 | public partial class PictureWin : Form 7 | { 8 | public PictureWin(Image image) 9 | { 10 | InitializeComponent(); 11 | fgiBox.Image = Program.ResizeImage(image, fgiBox.Width, fgiBox.Height); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /krkrFgiEditor/PictureWin.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 | 121 | 122 | 123 | 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 156 | 157 | 158 | -------------------------------------------------------------------------------- /krkrFgiEditor/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Drawing.Imaging; 5 | using System.Windows.Forms; 6 | 7 | namespace krkrFgiEditor 8 | { 9 | internal static class Program 10 | { 11 | /// 12 | /// 应用程序的主入口点。 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new MainWin()); 20 | } 21 | 22 | public static Image ResizeImage(Image image, int width, int height) 23 | { 24 | float widthRatio = (float)image.Width / width; 25 | float heightRatio = (float)image.Height / height; 26 | int newWidth, newHeight; 27 | if (widthRatio < heightRatio) 28 | { 29 | newWidth = (int)(image.Width / heightRatio); 30 | newHeight = height; 31 | } 32 | else 33 | { 34 | newWidth = width; 35 | newHeight = (int)(image.Height / widthRatio); 36 | } 37 | return image.GetThumbnailImage(newWidth, newHeight, () => false, IntPtr.Zero); 38 | } 39 | 40 | public static unsafe Bitmap GetTransparent(in Image image, byte opacity) 41 | { 42 | Bitmap result = new Bitmap(image); 43 | BitmapData resultData = result.LockBits(new Rectangle(0, 0, result.Width, result.Height), 44 | ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); 45 | byte* row = (byte*)resultData.Scan0.ToPointer(); 46 | int bpp = 4; 47 | int stride = resultData.Stride; 48 | for (int y = 0; y < result.Height; y++) 49 | { 50 | int bi = 0, gi = 1, ri = 2, ai = 3; 51 | for (int x = 0; x < result.Width; x++) 52 | { 53 | if (row[ai] != 0) 54 | row[ai] = (byte)(row[ai] * (double)opacity / 255); 55 | ai += bpp; 56 | bi += bpp; 57 | gi += bpp; 58 | ri += bpp; 59 | } 60 | row += stride; 61 | } 62 | result.UnlockBits(resultData); 63 | return result; 64 | } 65 | 66 | public static unsafe int AddAlphas(in Image image) 67 | { 68 | int alphas = 0; 69 | Bitmap img = new Bitmap(image); 70 | BitmapData imageData = img.LockBits(new Rectangle(0, 0, image.Width, image.Height), 71 | ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); 72 | byte* row = (byte*)imageData.Scan0.ToPointer(); 73 | int bpp = 4; 74 | int stride = imageData.Stride; 75 | for (int y = 0; y < image.Height; y++) 76 | { 77 | int bi = 0, gi = 1, ri = 2, ai = 3; 78 | for (int x = 0; x < image.Width; x++) 79 | { 80 | alphas += row[ai]; 81 | ai += bpp; 82 | bi += bpp; 83 | gi += bpp; 84 | ri += bpp; 85 | } 86 | row += stride; 87 | } 88 | img.UnlockBits(imageData); 89 | img.Dispose(); 90 | return alphas; 91 | } 92 | } 93 | 94 | public class Layer 95 | { 96 | private Image image; 97 | 98 | public string name; 99 | public int left; 100 | public int top; 101 | public byte opacity; 102 | public int layerId; 103 | public Image Image 104 | { 105 | get 106 | { 107 | return image; 108 | } 109 | set 110 | { 111 | if (image != null) 112 | image.Dispose(); 113 | image = value; 114 | } 115 | } 116 | 117 | ~Layer() 118 | { 119 | if (Image != null) 120 | Image.Dispose(); 121 | } 122 | 123 | public static bool HasNone(List layers) 124 | { 125 | foreach (Layer layer in layers) 126 | if (layer.Image == null) 127 | return true; 128 | return false; 129 | } 130 | 131 | public static bool IsAllNone(List layers) 132 | { 133 | foreach (Layer layer in layers) 134 | if (layer.Image != null) 135 | return false; 136 | return true; 137 | } 138 | 139 | public static Image GenerateImage(List layers) 140 | { 141 | if (layers.Count == 0 || IsAllNone(layers)) 142 | return null; 143 | int left = int.MaxValue, right = 0, top = int.MaxValue, bottom = 0; 144 | foreach (Layer layer in layers) 145 | { 146 | if (layer.Image == null) 147 | continue; 148 | int layerRight = layer.left + layer.Image.Width; 149 | int layerBottom = layer.top + layer.Image.Height; 150 | if (layer.left < left) 151 | left = layer.left; 152 | if (layerRight > right) 153 | right = layerRight; 154 | if (layer.top < top) 155 | top = layer.top; 156 | if (layerBottom > bottom) 157 | bottom = layerBottom; 158 | } 159 | int width = right - left; 160 | int height = bottom - top; 161 | Image image = new Bitmap(width, height); 162 | Graphics g = Graphics.FromImage(image); 163 | foreach (Layer layer in layers) 164 | if (layer.Image != null) 165 | if (layer.opacity == 255) 166 | g.DrawImage(layer.Image, layer.left - left, layer.top - top, 167 | layer.Image.Width, layer.Image.Height); 168 | else 169 | g.DrawImage(Program.GetTransparent(layer.Image, layer.opacity), 170 | layer.left - left, layer.top - top, 171 | layer.Image.Width, layer.Image.Height); 172 | g.Dispose(); 173 | return image; 174 | } 175 | } 176 | 177 | public class GroupLayer 178 | { 179 | public string name; 180 | public int groupLayerId; 181 | public List layers; 182 | ~GroupLayer() 183 | { 184 | layers.Clear(); 185 | } 186 | } 187 | } 188 | 189 | -------------------------------------------------------------------------------- /krkrFgiEditor/ProgressWin.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace krkrFgiEditor 2 | { 3 | partial class ProgressWin 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 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProgressWin)); 32 | this.progressBar = new System.Windows.Forms.ProgressBar(); 33 | this.SuspendLayout(); 34 | // 35 | // progressBar 36 | // 37 | this.progressBar.Location = new System.Drawing.Point(12, 17); 38 | this.progressBar.Name = "progressBar"; 39 | this.progressBar.Size = new System.Drawing.Size(554, 35); 40 | this.progressBar.TabIndex = 0; 41 | // 42 | // ProgressWin 43 | // 44 | this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F); 45 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 46 | this.ClientSize = new System.Drawing.Size(578, 69); 47 | this.Controls.Add(this.progressBar); 48 | this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 49 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 50 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 51 | this.Margin = new System.Windows.Forms.Padding(4); 52 | this.MaximizeBox = false; 53 | this.MinimizeBox = false; 54 | this.Name = "ProgressWin"; 55 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 56 | this.Text = "正在合成"; 57 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ProgressWin_FormClosing); 58 | this.ResumeLayout(false); 59 | 60 | } 61 | 62 | #endregion 63 | 64 | private System.Windows.Forms.ProgressBar progressBar; 65 | } 66 | } -------------------------------------------------------------------------------- /krkrFgiEditor/ProgressWin.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Windows.Forms; 3 | 4 | namespace krkrFgiEditor 5 | { 6 | public partial class ProgressWin : Form 7 | { 8 | public ProgressWin(int Maximum) 9 | { 10 | InitializeComponent(); 11 | progressBar.Maximum = Maximum; 12 | cts = new CancellationTokenSource(); 13 | } 14 | 15 | public CancellationTokenSource cts; 16 | 17 | public void AddProgress() 18 | { 19 | progressBar.Value++; 20 | } 21 | 22 | private void ProgressWin_FormClosing(object sender, FormClosingEventArgs e) 23 | { 24 | cts.Cancel(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /krkrFgiEditor/ProgressWin.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 | 121 | 122 | 123 | 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 156 | 157 | 158 | -------------------------------------------------------------------------------- /krkrFgiEditor/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // 有关程序集的一般信息由以下 5 | // 控制。更改这些特性值可修改 6 | // 与程序集关联的信息。 7 | [assembly: AssemblyTitle("krkrFgiEditor")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("HP Inc.")] 11 | [assembly: AssemblyProduct("krkrFgiEditor")] 12 | [assembly: AssemblyCopyright("Copyright © HP Inc. 2022")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // 将 ComVisible 设置为 false 会使此程序集中的类型 17 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 18 | //请将此类型的 ComVisible 特性设置为 true。 19 | [assembly: ComVisible(false)] 20 | 21 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 22 | [assembly: Guid("74c73890-7aa6-49fc-8c86-ce1fe18ed307")] 23 | 24 | // 程序集的版本信息由下列四个值组成: 25 | // 26 | // 主版本 27 | // 次版本 28 | // 生成号 29 | // 修订号 30 | // 31 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 32 | //通过使用 "*",如下所示: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /krkrFgiEditor/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace krkrFgiEditor.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 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 | /// 返回此类使用的缓存 ResourceManager 实例。 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("krkrFgiEditor.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 重写当前线程的 CurrentUICulture 属性,对 56 | /// 使用此强类型资源类的所有资源查找执行重写。 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 | -------------------------------------------------------------------------------- /krkrFgiEditor/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 | -------------------------------------------------------------------------------- /krkrFgiEditor/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 krkrFgiEditor.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 | -------------------------------------------------------------------------------- /krkrFgiEditor/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /krkrFgiEditor/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 54 | 55 | 56 | 57 | true 58 | true 59 | 60 | 61 | 62 | 63 | 64 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /krkrFgiEditor/krkrFgiEditor.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {74C73890-7AA6-49FC-8C86-CE1FE18ED307} 8 | WinExe 9 | krkrFgiEditor 10 | krkrFgiEditor 11 | v4.8 12 | 512 13 | true 14 | true 15 | publish\ 16 | true 17 | Disk 18 | false 19 | Foreground 20 | 7 21 | Days 22 | false 23 | false 24 | true 25 | 0 26 | 1.0.0.%2a 27 | false 28 | false 29 | true 30 | 31 | 32 | 33 | 34 | AnyCPU 35 | true 36 | full 37 | false 38 | bin\Debug\ 39 | DEBUG;TRACE 40 | prompt 41 | 4 42 | true 43 | true 44 | 45 | 46 | AnyCPU 47 | pdbonly 48 | true 49 | bin\Release\ 50 | TRACE 51 | prompt 52 | 4 53 | true 54 | 55 | 56 | krkrFgiEditor.ico 57 | 58 | 59 | 60 | app.manifest 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | Component 85 | 86 | 87 | ComboBoxEx.cs 88 | 89 | 90 | Form 91 | 92 | 93 | BatchWin.cs 94 | 95 | 96 | Form 97 | 98 | 99 | ProgressWin.cs 100 | 101 | 102 | Form 103 | 104 | 105 | PictureWin.cs 106 | 107 | 108 | Component 109 | 110 | 111 | ListBoxEx.cs 112 | 113 | 114 | Form 115 | 116 | 117 | MainWin.cs 118 | 119 | 120 | 121 | 122 | BatchWin.cs 123 | 124 | 125 | ProgressWin.cs 126 | 127 | 128 | PictureWin.cs 129 | 130 | 131 | MainWin.cs 132 | 133 | 134 | ResXFileCodeGenerator 135 | Resources.Designer.cs 136 | Designer 137 | 138 | 139 | True 140 | Resources.resx 141 | 142 | 143 | 144 | SettingsSingleFileGenerator 145 | Settings.Designer.cs 146 | 147 | 148 | True 149 | Settings.settings 150 | True 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | False 162 | Microsoft .NET Framework 4.8 %28x86 和 x64%29 163 | true 164 | 165 | 166 | False 167 | .NET Framework 3.5 SP1 168 | false 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /krkrFgiEditor/krkrFgiEditor.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CjangCjengh/krkrFgiEditor/85054e6c1b85b95ec4ee791fa5d7c076f5ae5e20/krkrFgiEditor/krkrFgiEditor.ico --------------------------------------------------------------------------------