Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
ImgGen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ImgGen
Commits
0b47e424
Commit
0b47e424
authored
Mar 20, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:mycard/ImgGen
parents
cba68c1e
580567e6
Pipeline
#2711
failed with stages
in 2 minutes and 39 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
ImageManager.cs
ImageManager.cs
+6
-6
Program.cs
Program.cs
+5
-2
readme.txt
readme.txt
+4
-0
No files found.
ImageManager.cs
View file @
0b47e424
...
@@ -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
;
...
...
Program.cs
View file @
0b47e424
...
@@ -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
.
GetFile
s
(
"./fonts"
))
if
(
Directory
.
Exist
s
(
"./fonts"
))
{
{
fontCollection
.
AddFontFile
(
font
);
foreach
(
string
font
in
Directory
.
GetFiles
(
"./fonts"
))
{
fontCollection
.
AddFontFile
(
font
);
}
}
}
encoderInfo
=
GetEncoderInfo
(
"image/jpeg"
);
encoderInfo
=
GetEncoderInfo
(
"image/jpeg"
);
...
...
readme.txt
View file @
0b47e424
...
@@ -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目录内生成卡图。
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment