Commit 55323482 authored by mercury233's avatar mercury233

minor refactor, support png input

parent 13b7981f
This diff is collapsed.
namespace ImgGen
{
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
......@@ -35,7 +36,9 @@
EncoderParameters encoderParams = new EncoderParameters(1);
EncoderParameter parameter = new EncoderParameter(quality, 90L);
encoderParams.Param[0] = parameter;
string[] files = Directory.GetFiles("./pico", "*.jpg");
List<string> files = new List<string>();
files.AddRange(Directory.GetFiles("./pico", "*.png"));
files.AddRange(Directory.GetFiles("./pico", "*.jpg"));
bool generateLarge = System.Configuration.ConfigurationManager.AppSettings["GenerateLarge"] == "False" ? false : true; // true if AppSettings null
bool generateSmall = System.Configuration.ConfigurationManager.AppSettings["GenerateSmall"] == "True" ? true : false;
bool generateThumb = System.Configuration.ConfigurationManager.AppSettings["GenerateThumb"] == "True" ? true : false;
......@@ -48,7 +51,7 @@
foreach (string str in files)
{
int code = int.Parse(Path.GetFileNameWithoutExtension(str));
string fileName = Path.GetFileName(str);
string fileName = code.ToString() + ".jpg";
Console.WriteLine("Generating {0}", fileName);
Bitmap image = DataManager.GetImage(code);
if (generateLarge)
......
YGOPro卡图生成工具
YGOPro卡图生成工具
------------------------------------------------
使用:
放到游戏主目录Gen目录,即执行目录上级有cards.cdb
使用:
放到游戏主目录Gen目录,即执行目录上级有cards.cdb
必备字体:
文泉驿微米黑
必备字体:
文泉驿微米黑
生成卡图:
在执行目录创建pico目录,放入对应密码的中间图规格的jpg图片,运行ImgGen.exe,即可在picn目录内生成卡图。
生成卡图:
在执行目录创建pico目录,放入对应密码的中间图规格的jpg图片,运行ImgGen.exe,即可在picn目录内生成卡图。
普通中间图尺寸:256x256
灵摆中间图尺寸:292x217
普通中间图尺寸:304x304
灵摆中间图尺寸:347x260
参数:
参数:
自定义数据库
自定义数据库
ImgGen.exe ..\expansions\pre-release.cdb
配置:
配置:
XyzString
自定义Xyz的翻译,默认为超量
自定义Xyz的翻译,默认为超量
FontName
自定义字体,默认为文泉驿微米黑
自定义字体,默认为文泉驿微米黑
ZeroStarCards
红龙等没有星星的怪兽卡,用逗号分开
红龙等没有星星的怪兽卡,用逗号分开
GenerateLarge
生成大图,默认为True
生成大图,默认为True
GenerateSmall
生成小图,默认为False
生成小图,默认为False
GenerateThumb
生成缩略图,默认为False
生成缩略图,默认为False
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment