Commit 0b47e424 authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:mycard/ImgGen

parents cba68c1e 580567e6
Pipeline #2711 failed with stages
in 2 minutes and 39 seconds
...@@ -155,8 +155,8 @@ namespace ImgGen ...@@ -155,8 +155,8 @@ namespace ImgGen
{ {
Bitmap image = null; Bitmap image = null;
string filename = "./pico/" + data.code.ToString() + ".jpg"; string filename = "./pico/" + data.code.ToString() + ".jpg";
//if (!File.Exists(filename)) if (!File.Exists(filename))
// filename = "./pico/" + data.code.ToString() + ".png"; filename = "./pico/" + data.code.ToString() + ".png";
try try
{ {
image = new Bitmap(filename); image = new Bitmap(filename);
...@@ -177,7 +177,7 @@ namespace ImgGen ...@@ -177,7 +177,7 @@ namespace ImgGen
{ {
graphics.FillRectangle(pendBgBrush, new Rectangle(23, 362, 354, 189)); graphics.FillRectangle(pendBgBrush, new Rectangle(23, 362, 354, 189));
Rectangle dest = new Rectangle(27, 103, 347, 259); Rectangle dest = new Rectangle(27, 103, 347, 259);
if (image.Width == 407 && image.Height == 593) // 官网图 if (image.Width == 407 && image.Height >= 593) // 官网图
graphics.DrawImage(image, dest, new Rectangle(27, 106, 353, 263), GraphicsUnit.Pixel); graphics.DrawImage(image, dest, new Rectangle(27, 106, 353, 263), GraphicsUnit.Pixel);
else else
graphics.DrawImage(image, dest); graphics.DrawImage(image, dest);
...@@ -186,7 +186,7 @@ namespace ImgGen ...@@ -186,7 +186,7 @@ namespace ImgGen
else else
{ {
Rectangle dest = new Rectangle(48, 106, 304, 304); Rectangle dest = new Rectangle(48, 106, 304, 304);
if (image.Width == 407 && image.Height == 593) // 官网图 if (image.Width == 407 && image.Height >= 593) // 官网图
graphics.DrawImage(image, dest, new Rectangle(49, 109, 308, 308), GraphicsUnit.Pixel); graphics.DrawImage(image, dest, new Rectangle(49, 109, 308, 308), GraphicsUnit.Pixel);
else if (image.Width == 1030 && image.Height == 740) // 官推图 else if (image.Width == 1030 && image.Height == 740) // 官推图
graphics.DrawImage(image, dest, new Rectangle(100, 164, 339, 339), GraphicsUnit.Pixel); graphics.DrawImage(image, dest, new Rectangle(100, 164, 339, 339), GraphicsUnit.Pixel);
...@@ -275,7 +275,7 @@ namespace ImgGen ...@@ -275,7 +275,7 @@ namespace ImgGen
{ {
for (nStar = 0; nStar < level; nStar++) for (nStar = 0; nStar < level; nStar++)
{ {
graphics.DrawImage(bStar[1], 41f + (26.5f * nStar), 69, 28, 28); graphics.DrawImage(bStar[1], (level==13 ? 27.5f : 41f) + (26.5f * nStar), 69, 28, 28);
} }
} }
else if (!data.isType(Type.TYPE_LINK)) else if (!data.isType(Type.TYPE_LINK))
...@@ -354,7 +354,7 @@ namespace ImgGen ...@@ -354,7 +354,7 @@ namespace ImgGen
case Race.RACE_DINOSAUR: str += "恐龙族"; break; case Race.RACE_DINOSAUR: str += "恐龙族"; break;
case Race.RACE_FISH: str += "鱼族"; break; case Race.RACE_FISH: str += "鱼族"; break;
case Race.RACE_SEASERPENT: str += "海龙族"; break; case Race.RACE_SEASERPENT: str += "海龙族"; break;
case Race.RACE_REPTILE: str += "爬虫族"; break; case Race.RACE_REPTILE: str += "爬虫族"; break;
case Race.RACE_PSYCHO: str += "念动力族"; break; case Race.RACE_PSYCHO: str += "念动力族"; break;
case Race.RACE_DEVINE: str += "幻神兽族"; break; case Race.RACE_DEVINE: str += "幻神兽族"; break;
case Race.RACE_CREATORGOD: str += "创造神族"; break; case Race.RACE_CREATORGOD: str += "创造神族"; break;
......
...@@ -58,9 +58,12 @@ namespace ImgGen ...@@ -58,9 +58,12 @@ namespace ImgGen
private static void Main(string[] args) private static void Main(string[] args)
{ {
fontCollection = new PrivateFontCollection(); fontCollection = new PrivateFontCollection();
foreach (string font in Directory.GetFiles("./fonts")) if (Directory.Exists("./fonts"))
{ {
fontCollection.AddFontFile(font); foreach (string font in Directory.GetFiles("./fonts"))
{
fontCollection.AddFontFile(font);
}
} }
encoderInfo = GetEncoderInfo("image/jpeg"); encoderInfo = GetEncoderInfo("image/jpeg");
......
...@@ -3,6 +3,9 @@ YGOPro卡图生成工具 ...@@ -3,6 +3,9 @@ YGOPro卡图生成工具
预览: 预览:
https://github.com/mycard/ImgGen/wiki/效果预览 https://github.com/mycard/ImgGen/wiki/效果预览
Windows 10说明:
因为一些神秘原因,Windows 10中字体的渲染极为丑陋,在此问题由微软解决前不建议使用Windows 10运行本工具。
使用: 使用:
放到游戏主目录Gen目录,即执行目录上级有cards.cdb 放到游戏主目录Gen目录,即执行目录上级有cards.cdb
也可以使用本项目的 Dockerfile 构建的镜像。挂载相应数据卷之后直接运行即可。数据卷如下。 也可以使用本项目的 Dockerfile 构建的镜像。挂载相应数据卷之后直接运行即可。数据卷如下。
...@@ -15,6 +18,7 @@ https://github.com/mycard/ImgGen/wiki/效果预览 ...@@ -15,6 +18,7 @@ https://github.com/mycard/ImgGen/wiki/效果预览
文泉驿微米黑 文泉驿微米黑
方正隶变_GBK 方正隶变_GBK
MatrixBoldSmallCaps MatrixBoldSmallCaps
字体可安装至系统,也可放至fonts目录
生成卡图: 生成卡图:
在执行目录创建pico目录,放入对应密码的中间图规格的png或jpg图片,运行ImgGen.exe,即可在picn目录内生成卡图。 在执行目录创建pico目录,放入对应密码的中间图规格的png或jpg图片,运行ImgGen.exe,即可在picn目录内生成卡图。
......
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