Commit 80b43737 authored by mercury233's avatar mercury233

series 10

parent e2a06523
...@@ -12,7 +12,7 @@ namespace ImgGen ...@@ -12,7 +12,7 @@ namespace ImgGen
private static Bitmap[] bAttributes = new Bitmap[8]; private static Bitmap[] bAttributes = new Bitmap[8];
private static Bitmap[] bStar = new Bitmap[2]; private static Bitmap[] bStar = new Bitmap[2];
private static Bitmap[] bTemplates = new Bitmap[15]; private static Bitmap[] bTemplates = new Bitmap[15];
private static Bitmap[] bType = new Bitmap[15]; private static Bitmap[] bType = new Bitmap[9];
private static Bitmap[] bLinkMarkers1 = new Bitmap[9]; private static Bitmap[] bLinkMarkers1 = new Bitmap[9];
private static Bitmap[] bLinkMarkers2 = new Bitmap[9]; private static Bitmap[] bLinkMarkers2 = new Bitmap[9];
...@@ -133,28 +133,28 @@ namespace ImgGen ...@@ -133,28 +133,28 @@ namespace ImgGen
{ {
xyzString = xyz; xyzString = xyz;
conn = new SQLiteConnection("Data Source=" + dbPath); conn = new SQLiteConnection("Data Source=" + dbPath);
numFont = new Font("Arial", 5.5f); numFont = new Font("文泉驿微米黑", 12, FontStyle.Regular, GraphicsUnit.Pixel);
linkFont = new Font("Tohoma", 5.5f, FontStyle.Bold); linkFont = new Font("文泉驿微米黑", 12, FontStyle.Bold, GraphicsUnit.Pixel);
nameFont = new Font("文泉驿微米黑", 10f); nameFont = new Font("文泉驿微米黑", 24, GraphicsUnit.Pixel);
typeFont = new Font("文泉驿微米黑", 6f); typeFont = new Font("文泉驿微米黑", 12, FontStyle.Regular, GraphicsUnit.Pixel);
txtFont = new Font("文泉驿微米黑", 5f); txtFont = new Font("文泉驿微米黑", 10, GraphicsUnit.Pixel);
scaleFontNormal = new Font("文泉驿微米黑", 8f); scaleFontNormal = new Font("文泉驿微米黑", 24, GraphicsUnit.Pixel);
scaleFontSmall = new Font("文泉驿微米黑", 7f); scaleFontSmall = new Font("文泉驿微米黑", 20, GraphicsUnit.Pixel);
bTemplates[0] = new Bitmap("./textures/card_spell.jpg"); bTemplates[0] = new Bitmap("./textures/card_spell.png");
bTemplates[1] = new Bitmap("./textures/card_trap.jpg"); bTemplates[1] = new Bitmap("./textures/card_trap.png");
bTemplates[2] = new Bitmap("./textures/card_synchro.jpg"); bTemplates[2] = new Bitmap("./textures/card_synchro.png");
bTemplates[3] = new Bitmap("./textures/card_xyz.jpg"); bTemplates[3] = new Bitmap("./textures/card_xyz.png");
bTemplates[4] = new Bitmap("./textures/card_fusion.jpg"); bTemplates[4] = new Bitmap("./textures/card_fusion.png");
bTemplates[5] = new Bitmap("./textures/card_ritual.jpg"); bTemplates[5] = new Bitmap("./textures/card_ritual.png");
bTemplates[6] = new Bitmap("./textures/card_token.jpg"); bTemplates[6] = new Bitmap("./textures/card_token.png");
bTemplates[7] = new Bitmap("./textures/card_effect.jpg"); bTemplates[7] = new Bitmap("./textures/card_effect.png");
bTemplates[8] = new Bitmap("./textures/card_normal.jpg"); bTemplates[8] = new Bitmap("./textures/card_normal.png");
bTemplates[9] = new Bitmap("./textures/card_pxyz.jpg"); bTemplates[9] = new Bitmap("./textures/card_pxyz.png");
bTemplates[10] = new Bitmap("./textures/card_peffect.jpg"); bTemplates[10] = new Bitmap("./textures/card_peffect.png");
bTemplates[11] = new Bitmap("./textures/card_pnormal.jpg"); bTemplates[11] = new Bitmap("./textures/card_pnormal.png");
bTemplates[12] = new Bitmap("./textures/card_psynchro.jpg"); bTemplates[12] = new Bitmap("./textures/card_psynchro.png");
bTemplates[13] = new Bitmap("./textures/card_pfusion.jpg"); bTemplates[13] = new Bitmap("./textures/card_pfusion.png");
bTemplates[14] = new Bitmap("./textures/card_link.jpg"); bTemplates[14] = new Bitmap("./textures/card_link.png");
bAttributes[0] = new Bitmap("./textures/att_earth.png"); bAttributes[0] = new Bitmap("./textures/att_earth.png");
bAttributes[1] = new Bitmap("./textures/att_water.png"); bAttributes[1] = new Bitmap("./textures/att_water.png");
bAttributes[2] = new Bitmap("./textures/att_fire.png"); bAttributes[2] = new Bitmap("./textures/att_fire.png");
...@@ -164,16 +164,15 @@ namespace ImgGen ...@@ -164,16 +164,15 @@ namespace ImgGen
bAttributes[6] = new Bitmap("./textures/att_devine.png"); bAttributes[6] = new Bitmap("./textures/att_devine.png");
bStar[0] = new Bitmap("./textures/star.png"); bStar[0] = new Bitmap("./textures/star.png");
bStar[1] = new Bitmap("./textures/starb.png"); bStar[1] = new Bitmap("./textures/starb.png");
bType[0] = new Bitmap("./textures/spell1.png"); bType[0] = new Bitmap("./textures/spell_normal.png");
bType[1] = new Bitmap("./textures/spell2.png"); bType[1] = new Bitmap("./textures/spell_quickplay.png");
bType[2] = new Bitmap("./textures/trap1.png"); bType[2] = new Bitmap("./textures/spell_continuous.png");
bType[3] = new Bitmap("./textures/trap2.png"); bType[3] = new Bitmap("./textures/spell_equip.png");
bType[4] = new Bitmap("./textures/type_continuous.png"); bType[4] = new Bitmap("./textures/spell_field.png");
bType[5] = new Bitmap("./textures/type_counter.png"); bType[5] = new Bitmap("./textures/spell_ritual.png");
bType[6] = new Bitmap("./textures/type_equip.png"); bType[6] = new Bitmap("./textures/trap_normal.png");
bType[7] = new Bitmap("./textures/type_field.png"); bType[7] = new Bitmap("./textures/trap_continuous.png");
bType[8] = new Bitmap("./textures/type_quickplay.png"); bType[8] = new Bitmap("./textures/trap_counter.png");
bType[9] = new Bitmap("./textures/type_ritual.png");
for (int i = 1; i <= 9; i++) for (int i = 1; i <= 9; i++)
{ {
if (i == 5) continue; if (i == 5) continue;
...@@ -254,42 +253,44 @@ namespace ImgGen ...@@ -254,42 +253,44 @@ namespace ImgGen
{ {
bitmap = new Bitmap(bTemplates[1]); bitmap = new Bitmap(bTemplates[1]);
} }
else if (data.isType(Type.TYPE_SYNCHRO)) else if (data.isType(Type.TYPE_PENDULUM))
{ {
if (data.isType(Type.TYPE_PENDULUM)) if (data.isType(Type.TYPE_SYNCHRO))
{ {
bitmap = new Bitmap(bTemplates[12]); bitmap = new Bitmap(bTemplates[12]);
} }
else else if (data.isType(Type.TYPE_XYZ))
{ {
bitmap = new Bitmap(bTemplates[2]); bitmap = new Bitmap(bTemplates[9]);
}
else if (data.isType(Type.TYPE_FUSION))
{
bitmap = new Bitmap(bTemplates[13]);
}
else if (data.isType(Type.TYPE_EFFECT))
{
bitmap = new Bitmap(bTemplates[10]);
}
else //pnormal
{
bitmap = new Bitmap(bTemplates[11]);
} }
} }
else if (data.isType(Type.TYPE_LINK)) else if (data.isType(Type.TYPE_LINK))
{ {
bitmap = new Bitmap(bTemplates[14]); bitmap = new Bitmap(bTemplates[14]);
} }
else if (data.isType(Type.TYPE_SYNCHRO))
{
bitmap = new Bitmap(bTemplates[2]);
}
else if (data.isType(Type.TYPE_XYZ)) else if (data.isType(Type.TYPE_XYZ))
{ {
if (data.isType(Type.TYPE_PENDULUM)) bitmap = new Bitmap(bTemplates[3]);
{
bitmap = new Bitmap(bTemplates[9]);
}
else
{
bitmap = new Bitmap(bTemplates[3]);
}
} }
else if (data.isType(Type.TYPE_FUSION)) else if (data.isType(Type.TYPE_FUSION))
{ {
if (data.isType(Type.TYPE_PENDULUM)) bitmap = new Bitmap(bTemplates[4]);
{
bitmap = new Bitmap(bTemplates[13]);
}
else
{
bitmap = new Bitmap(bTemplates[4]);
}
} }
else if (data.isType(Type.TYPE_RITUAL)) else if (data.isType(Type.TYPE_RITUAL))
{ {
...@@ -301,265 +302,130 @@ namespace ImgGen ...@@ -301,265 +302,130 @@ namespace ImgGen
} }
else if (data.isType(Type.TYPE_EFFECT)) else if (data.isType(Type.TYPE_EFFECT))
{ {
if (data.isType(Type.TYPE_PENDULUM)) bitmap = new Bitmap(bTemplates[7]);
{
bitmap = new Bitmap(bTemplates[10]);
}
else
{
bitmap = new Bitmap(bTemplates[7]);
}
} }
else else //normal
{ {
if (data.isType(Type.TYPE_PENDULUM)) bitmap = new Bitmap(bTemplates[8]);
{
bitmap = new Bitmap(bTemplates[11]);
}
else
{
bitmap = new Bitmap(bTemplates[8]);
}
} }
Graphics graphics = Graphics.FromImage(bitmap); Graphics graphics = Graphics.FromImage(bitmap);
text.text = GetStandardText(text.text); text.text = GetStandardText(text.text);
if (data.isType(Type.TYPE_MONSTER)) if (data.isType(Type.TYPE_MONSTER))
{ {
int x = 144;
int y = 15;
int nStar; int nStar;
if (!data.isType(Type.TYPE_LINK) && !data.isType(Type.TYPE_XYZ)) if (data.isType(Type.TYPE_XYZ))
{ {
if (!data.isType(Type.TYPE_PENDULUM)) for (nStar = 0; nStar < (data.level & 0xff); nStar++)
{
for (nStar = 0; nStar < (data.level & 0xff); nStar++)
{
graphics.DrawImage(bStar[0], 149 - (12 * nStar), 37, 11, 11);
}
}
else
{ {
for (nStar = 0; nStar < (data.level & 0xff); nStar++) graphics.DrawImage(bStar[1], (int)35 + (22.5f * nStar), 60, 20, 20);
{
graphics.DrawImage(bStar[0], 149 - (12 * nStar), 35, 11, 11);
}
y = 12;
} }
} }
if (data.isType(Type.TYPE_LINK)) else if (!data.isType(Type.TYPE_LINK))
{
x = 147;
y = 11;
}
else if (data.isType(Type.TYPE_XYZ))
{ {
for (nStar = 0; nStar < (data.level & 0xff); nStar++) for (nStar = 0; nStar < (data.level & 0xff); nStar++)
{ {
graphics.DrawImage(bStar[1], 17 + (12 * nStar), 35, 11, 11); graphics.DrawImage(bStar[0], (int)282 - (22.5f * nStar), 60, 20, 20);
} }
y = 12;
} }
if (data.attribute == Attribute.ATTRIBUTE_EARTH)
{ int nAttr;
graphics.DrawImage(bAttributes[0], x, y, 18, 18); if (data.attribute == Attribute.ATTRIBUTE_EARTH) nAttr = 0;
} else if (data.attribute == Attribute.ATTRIBUTE_WATER) nAttr = 1;
else if (data.attribute == Attribute.ATTRIBUTE_WATER) else if (data.attribute == Attribute.ATTRIBUTE_FIRE) nAttr = 2;
{ else if (data.attribute == Attribute.ATTRIBUTE_WIND) nAttr = 3;
graphics.DrawImage(bAttributes[1], x, y, 18, 18); else if (data.attribute == Attribute.ATTRIBUTE_LIGHT) nAttr = 4;
} else if (data.attribute == Attribute.ATTRIBUTE_DARK) nAttr = 5;
else if (data.attribute == Attribute.ATTRIBUTE_FIRE) else nAttr = 6;
{ graphics.DrawImage(bAttributes[nAttr], 280, 22, 32, 32);
graphics.DrawImage(bAttributes[2], x, y, 18, 18);
} if (data.attack >= 0)
else if (data.attribute == Attribute.ATTRIBUTE_WIND)
{
graphics.DrawImage(bAttributes[3], x, y, 18, 18);
}
else if (data.attribute == Attribute.ATTRIBUTE_LIGHT)
{ {
graphics.DrawImage(bAttributes[4], x, y, 18, 18); graphics.DrawString(data.attack.ToString(), numFont, Brushes.Black, 208, 446);
} }
else if (data.attribute == Attribute.ATTRIBUTE_DARK) else
{ {
graphics.DrawImage(bAttributes[5], x, y, 18, 18); graphics.DrawString("?", numFont, textBrush, 208, 446);
} }
else if (data.attribute == Attribute.ATTRIBUTE_DEVINE)
if (data.isType(Type.TYPE_LINK))
{ {
graphics.DrawImage(bAttributes[6], x, y, 18, 18); graphics.DrawString(data.level.ToString(), linkFont, Brushes.Black, 295, 446);
} }
if (data.isType(Type.TYPE_LINK)) else
{ {
if (data.attack >= 0) if (data.defence >= 0)
{ {
graphics.DrawString(data.attack.ToString(), numFont, Brushes.Black, 110f, 231f); graphics.DrawString(data.defence.ToString(), numFont, Brushes.Black, 275, 446);
} }
else else
{ {
graphics.DrawString("?", numFont, textBrush, 110f, 231f); graphics.DrawString("?", numFont, textBrush, 275, 446);
} }
graphics.DrawString(data.level.ToString(), linkFont, Brushes.Black, 156f, 231f);
} }
else if (!data.isType(Type.TYPE_PENDULUM))
string type_string = GetTypeString(data);
float tWidth = graphics.MeasureString(type_string, typeFont).Width;
float sx1 = 1f;
if (tWidth > 280f)
{ {
if (!data.isType(Type.TYPE_XYZ)) sx1 *= 280f / tWidth;
{
if (data.attack >= 0)
{
graphics.DrawString(data.attack.ToString(), numFont, Brushes.Black, 105f, 231f);
}
else
{
graphics.DrawString("?", numFont, textBrush, 115f, 231f);
}
if (data.defence >= 0)
{
graphics.DrawString(data.defence.ToString(), numFont, Brushes.Black, 142f, 231f);
}
else
{
graphics.DrawString("?", numFont, textBrush, 152f, 231f);
}
}
else
{
if (data.attack >= 0)
{
graphics.DrawString(data.attack.ToString(), numFont, Brushes.Black, 109f, 231f);
}
else
{
graphics.DrawString("?", numFont, textBrush, 119f, 231f);
}
if (data.defence >= 0)
{
graphics.DrawString(data.defence.ToString(), numFont, Brushes.Black, 145f, 231f);
}
else
{
graphics.DrawString("?", numFont, textBrush, 155f, 231f);
}
}
} }
else graphics.ScaleTransform(sx1, 1f);
graphics.DrawString(type_string, typeFont, typeBrush, 20, 369);
graphics.ResetTransform();
string monster_effect = text.text;
if (data.isType(Type.TYPE_PENDULUM))
{ {
if (data.attack >= 0) monster_effect = GetPendulumDesc(text.text, regex_monster);
{
graphics.DrawString(data.attack.ToString(), numFont, Brushes.Black, 105f, 231f);
}
else
{
graphics.DrawString("?", numFont, textBrush, 115f, 231f);
}
if (data.defence >= 0)
{
graphics.DrawString(data.defence.ToString(), numFont, Brushes.Black, 142f, 231f);
}
else
{
graphics.DrawString("?", numFont, textBrush, 152f, 231f);
}
} }
if (data.isType(Type.TYPE_LINK)) nWidth = 288;
ef = graphics.MeasureString(monster_effect, txtFont, nWidth);
while (ef.Height > 60 * nWidth / 288f)
{ {
graphics.DrawString(GetTypeString(data), typeFont, typeBrush, 10f, 192f); nWidth += 3;
ef = graphics.MeasureString(text.text, txtFont, 150); ef = graphics.MeasureString(monster_effect, txtFont, nWidth);
nWidth = 150;
while (ef.Height > 28 * nWidth / 150f)
{
nWidth += 3;
ef = graphics.MeasureString(text.text, txtFont, nWidth);
}
graphics.TranslateTransform(14f, 202f);
graphics.ScaleTransform(150f / nWidth, 150f / nWidth);
graphics.DrawString(text.text, txtFont, textBrush, new RectangleF(0f, 0f, ef.Width, ef.Height));
graphics.ResetTransform();
} }
else if (data.isType(Type.TYPE_PENDULUM)) graphics.TranslateTransform(24f, 385f);
graphics.ScaleTransform(288f / nWidth, 288f / nWidth);
graphics.DrawString(monster_effect, txtFont, textBrush, new RectangleF(0f, 0f, ef.Width, ef.Height));
graphics.ResetTransform();
if (data.isType(Type.TYPE_PENDULUM))
{ {
string type_string = GetTypeString(data);
float width1 = graphics.MeasureString(type_string, typeFont).Width;
float sx1 = 1f;
if (width1 > 150f)
{
sx1 *= 150f / width1;
}
graphics.ScaleTransform(sx1, 1f);
graphics.DrawString(type_string, typeFont, typeBrush, 12f, 192f);
graphics.ResetTransform();
string monster_effect = GetPendulumDesc(text.text, regex_monster);
string pendulum_effect = GetPendulumDesc(text.text, regex_pendulum);
int lscale = (data.level >> 0x18) & 0xff; int lscale = (data.level >> 0x18) & 0xff;
int rscale = (data.level >> 0x10) & 0xff; int rscale = (data.level >> 0x10) & 0xff;
if (lscale > 9) if (lscale > 9)
{ {
graphics.DrawString(lscale.ToString(), scaleFontSmall, Brushes.Black, 13f, 174f); graphics.DrawString(lscale.ToString(), scaleFontSmall, Brushes.Black, 20f, 336f);
} }
else else
{ {
graphics.DrawString(lscale.ToString(), scaleFontNormal, Brushes.Black, 16f, 174f); graphics.DrawString(lscale.ToString(), scaleFontNormal, Brushes.Black, 25f, 333f);
} }
if (rscale > 9) if (rscale > 9)
{ {
graphics.DrawString(rscale.ToString(), scaleFontSmall, Brushes.Black, 150f, 174f); graphics.DrawString(rscale.ToString(), scaleFontSmall, Brushes.Black, 286f, 336f);
} }
else else
{ {
graphics.DrawString(rscale.ToString(), scaleFontNormal, Brushes.Black, 151f, 174f); graphics.DrawString(rscale.ToString(), scaleFontNormal, Brushes.Black, 290f, 333f);
} }
ef = graphics.MeasureString(monster_effect, txtFont, 145);
nWidth = 145;
while (ef.Height > 28 * nWidth / 145f)
{
nWidth += 3;
ef = graphics.MeasureString(monster_effect, txtFont, nWidth);
}
graphics.TranslateTransform(16f, 202f);
graphics.ScaleTransform(145f / nWidth, 145f / nWidth);
graphics.DrawString(monster_effect, txtFont, textBrush, new RectangleF(0f, 0f, ef.Width, ef.Height));
graphics.ResetTransform();
int nWidthP; int nWidthP;
SizeF pf; SizeF pf;
pf = graphics.MeasureString(pendulum_effect, txtFont, 119); string pendulum_effect = GetPendulumDesc(text.text, regex_pendulum);
nWidthP = 119; nWidthP = 232;
while (pf.Height > 24 * nWidthP / 119f) pf = graphics.MeasureString(pendulum_effect, txtFont, nWidthP);
while (pf.Height > 52 * nWidthP / 232f)
{ {
nWidthP += 1; nWidthP += 1;
pf = graphics.MeasureString(pendulum_effect, txtFont, nWidthP); pf = graphics.MeasureString(pendulum_effect, txtFont, nWidthP);
} }
graphics.TranslateTransform(29f, 162f); graphics.TranslateTransform(51f, 311f);
graphics.ScaleTransform(119f / nWidthP, 119f / nWidthP); graphics.ScaleTransform(232f / nWidthP, 232f / nWidthP);
graphics.DrawString(pendulum_effect, txtFont, textBrush, new RectangleF(0f, 0f, pf.Width, pf.Height)); graphics.DrawString(pendulum_effect, txtFont, textBrush, new RectangleF(0f, 0f, pf.Width, pf.Height));
graphics.ResetTransform(); graphics.ResetTransform();
} }
else if (data.isType(Type.TYPE_XYZ))
{
graphics.DrawString(GetTypeString(data), typeFont, typeBrush, 12f, 192f);
ef = graphics.MeasureString(text.text, txtFont, 145);
nWidth = 145;
while (ef.Height > 28 * nWidth / 145f)
{
nWidth += 3;
ef = graphics.MeasureString(text.text, txtFont, nWidth);
}
graphics.TranslateTransform(16f, 202f);
graphics.ScaleTransform(145f / nWidth, 145f / nWidth);
graphics.DrawString(text.text, txtFont, textBrush, new RectangleF(0f, 0f, ef.Width, ef.Height));
graphics.ResetTransform();
}
else {
graphics.DrawString(GetTypeString(data), typeFont, typeBrush, 13f, 195f);
ef = graphics.MeasureString(text.text, txtFont, 145);
nWidth = 145;
while (ef.Height > 25 * nWidth / 145f)
{
nWidth += 3;
ef = graphics.MeasureString(text.text, txtFont, nWidth);
}
graphics.TranslateTransform(16f, 205f);
graphics.ScaleTransform(145f / nWidth, 145f / nWidth);
graphics.DrawString(text.text, txtFont, textBrush, new RectangleF(0f, 0f, ef.Width, ef.Height));
graphics.ResetTransform();
}
} }
else else
{ {
...@@ -567,61 +433,42 @@ namespace ImgGen ...@@ -567,61 +433,42 @@ namespace ImgGen
{ {
if (data.type == Type.TYPE_SPELL) if (data.type == Type.TYPE_SPELL)
{ {
graphics.DrawImage(bType[0], 101, 37); graphics.DrawImage(bType[0], 204, 60, 96, 19);
} }
else else
{ {
graphics.DrawImage(bType[1], 92, 37); int nType = 0;
if (data.isType(Type.TYPE_CONTINUOUS)) if (data.isType(Type.TYPE_QUICKPLAY)) nType = 1;
{ if (data.isType(Type.TYPE_CONTINUOUS)) nType = 2;
graphics.DrawImage(bType[4], 143, 40); if (data.isType(Type.TYPE_EQUIP)) nType = 3;
} if (data.isType(Type.TYPE_FIELD)) nType = 4;
else if (data.isType(Type.TYPE_EQUIP)) if (data.isType(Type.TYPE_RITUAL)) nType = 5;
{ graphics.DrawImage(bType[nType], 192, 60, 108, 19);
graphics.DrawImage(bType[6], 143, 40);
}
else if (data.isType(Type.TYPE_FIELD))
{
graphics.DrawImage(bType[7], 143, 40);
}
else if (data.isType(Type.TYPE_QUICKPLAY))
{
graphics.DrawImage(bType[8], 143, 40);
}
else if (data.isType(Type.TYPE_RITUAL))
{
graphics.DrawImage(bType[9], 143, 40);
}
} }
} }
else if (data.isType(Type.TYPE_TRAP)) else if (data.isType(Type.TYPE_TRAP))
{ {
if (data.type == Type.TYPE_TRAP) if (data.type == Type.TYPE_TRAP)
{ {
graphics.DrawImage(bType[2], 111, 37); graphics.DrawImage(bType[6], 221, 60, 80, 19);
} }
else else
{ {
graphics.DrawImage(bType[3], 102, 37); int nType = 6;
if (data.isType(Type.TYPE_CONTINUOUS)) if (data.isType(Type.TYPE_CONTINUOUS)) nType = 7;
{ if (data.isType(Type.TYPE_COUNTER)) nType = 8;
graphics.DrawImage(bType[4], 143, 40); graphics.DrawImage(bType[nType], 209, 60, 91, 19);
}
else if (data.isType(Type.TYPE_COUNTER))
{
graphics.DrawImage(bType[5], 143, 40);
}
} }
} }
ef = graphics.MeasureString(text.text, txtFont, 145); nWidth = 288;
nWidth = 145; ef = graphics.MeasureString(text.text, txtFont, nWidth);
while (ef.Height > 40 * nWidth / 145f) while (ef.Height > 80 * nWidth / 288f)
{ {
nWidth += 3; nWidth += 3;
ef = graphics.MeasureString(text.text, txtFont, nWidth); ef = graphics.MeasureString(text.text, txtFont, nWidth);
} }
graphics.TranslateTransform(16f, 195f); graphics.TranslateTransform(24f, 370f);
graphics.ScaleTransform(145f / nWidth, 145f / nWidth); graphics.ScaleTransform(288f / nWidth, 288f / nWidth);
graphics.DrawString(text.text, txtFont, textBrush, new RectangleF(0f, 0f, ef.Width, ef.Height)); graphics.DrawString(text.text, txtFont, textBrush, new RectangleF(0f, 0f, ef.Width, ef.Height));
graphics.ResetTransform(); graphics.ResetTransform();
} }
...@@ -633,22 +480,14 @@ namespace ImgGen ...@@ -633,22 +480,14 @@ namespace ImgGen
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
graphics.CompositingQuality = CompositingQuality.HighQuality; graphics.CompositingQuality = CompositingQuality.HighQuality;
graphics.SmoothingMode = SmoothingMode.AntiAlias; graphics.SmoothingMode = SmoothingMode.AntiAlias;
if (data.isType(Type.TYPE_LINK)) if (data.isType(Type.TYPE_PENDULUM))
{
graphics.DrawImage(image, 22, 47, 133, 133);
}
else if (data.isType(Type.TYPE_PENDULUM))
{ {
//graphics.DrawImage(image, 15, 50, 147, 109); //graphics.DrawImage(image, 15, 50, 147, 109);
graphics.DrawImage(image, new Rectangle(15, 50, 147, 109), new Rectangle(0, 0, image.Width, image.Width * 109 / 147), GraphicsUnit.Pixel); graphics.DrawImage(image, new Rectangle(23, 88, 290, 217), new Rectangle(0, 0, image.Width, image.Width * 217 / 290), GraphicsUnit.Pixel);
}
else if (!data.isType(Type.TYPE_XYZ))
{
graphics.DrawImage(image, 25, 54, 128, 128);
} }
else else
{ {
graphics.DrawImage(image, 24, 51, 128, 128); graphics.DrawImage(image, 40, 89, 256, 256);
} }
} }
catch (Exception e) catch (Exception e)
...@@ -659,64 +498,50 @@ namespace ImgGen ...@@ -659,64 +498,50 @@ namespace ImgGen
{ {
LinkMarker lm = (LinkMarker)data.defence; LinkMarker lm = (LinkMarker)data.defence;
if ((lm & LinkMarker.LINK_MARKER_BOTTOM_LEFT) == 0) if ((lm & LinkMarker.LINK_MARKER_BOTTOM_LEFT) == 0)
graphics.DrawImage(bLinkMarkers1[0], 14, 169, 18, 17); graphics.DrawImage(bLinkMarkers1[0], 26, 327, 34, 34);
else else
graphics.DrawImage(bLinkMarkers2[0], 14, 169, 18, 17); graphics.DrawImage(bLinkMarkers2[0], 26, 327, 34, 34);
if ((lm & LinkMarker.LINK_MARKER_BOTTOM) == 0) if ((lm & LinkMarker.LINK_MARKER_BOTTOM) == 0)
graphics.DrawImage(bLinkMarkers1[1], 73, 178, 32, 12); graphics.DrawImage(bLinkMarkers1[1], 139, 343, 62, 23);
else else
graphics.DrawImage(bLinkMarkers2[1], 73, 178, 32, 12); graphics.DrawImage(bLinkMarkers2[1], 139, 343, 62, 23);
if ((lm & LinkMarker.LINK_MARKER_BOTTOM_RIGHT) == 0) if ((lm & LinkMarker.LINK_MARKER_BOTTOM_RIGHT) == 0)
graphics.DrawImage(bLinkMarkers1[2], 145, 169, 18, 17); graphics.DrawImage(bLinkMarkers1[2], 277, 327, 35, 34);
else else
graphics.DrawImage(bLinkMarkers2[2], 145, 169, 18, 17); graphics.DrawImage(bLinkMarkers2[2], 277, 327, 35, 34);
if ((lm & LinkMarker.LINK_MARKER_LEFT) == 0) if ((lm & LinkMarker.LINK_MARKER_LEFT) == 0)
graphics.DrawImage(bLinkMarkers1[3], 11, 97, 12, 32); graphics.DrawImage(bLinkMarkers1[3], 20, 189, 23, 62);
else else
graphics.DrawImage(bLinkMarkers2[3], 11, 97, 12, 32); graphics.DrawImage(bLinkMarkers2[3], 20, 189, 23, 62);
if ((lm & LinkMarker.LINK_MARKER_RIGHT) == 0) if ((lm & LinkMarker.LINK_MARKER_RIGHT) == 0)
graphics.DrawImage(bLinkMarkers1[5], 154, 97, 12, 32); graphics.DrawImage(bLinkMarkers1[5], 294, 189, 23, 62);
else else
graphics.DrawImage(bLinkMarkers2[5], 154, 97, 12, 32); graphics.DrawImage(bLinkMarkers2[5], 294, 189, 23, 62);
if ((lm & LinkMarker.LINK_MARKER_TOP_LEFT) == 0) if ((lm & LinkMarker.LINK_MARKER_TOP_LEFT) == 0)
graphics.DrawImage(bLinkMarkers1[6], 14, 39, 18, 17); graphics.DrawImage(bLinkMarkers1[6], 26, 77, 35, 34);
else else
graphics.DrawImage(bLinkMarkers2[6], 14, 39, 18, 17); graphics.DrawImage(bLinkMarkers2[6], 26, 77, 35, 34);
if ((lm & LinkMarker.LINK_MARKER_TOP) == 0) if ((lm & LinkMarker.LINK_MARKER_TOP) == 0)
graphics.DrawImage(bLinkMarkers1[7], 73, 36, 32, 12); graphics.DrawImage(bLinkMarkers1[7], 138, 69, 63, 23);
else else
graphics.DrawImage(bLinkMarkers2[7], 73, 36, 32, 12); graphics.DrawImage(bLinkMarkers2[7], 138, 69, 63, 23);
if ((lm & LinkMarker.LINK_MARKER_TOP_RIGHT) == 0) if ((lm & LinkMarker.LINK_MARKER_TOP_RIGHT) == 0)
graphics.DrawImage(bLinkMarkers1[8], 146, 39, 18, 17); graphics.DrawImage(bLinkMarkers1[8], 278, 77, 34, 34);
else else
graphics.DrawImage(bLinkMarkers2[8], 146, 39, 18, 17); graphics.DrawImage(bLinkMarkers2[8], 278, 77, 34, 34);
} }
string str3 = text.name.Replace('\x00b7', '・'); string nametext = text.name.Replace('\x00b7', '・');
float width = graphics.MeasureString(str3, nameFont).Width; graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
float width = graphics.MeasureString(nametext, nameFont).Width;
float sx = 1f; float sx = 1f;
if (width > 130f) if (width > 265f)
{
sx *= 130f / width;
}
if (data.isType(Type.TYPE_LINK))
{
graphics.TranslateTransform(10f, 13f);
}
else if (data.isType(Type.TYPE_XYZ))
{
graphics.TranslateTransform(12f, 13f);
}
else if (data.isType(Type.TYPE_PENDULUM))
{
graphics.TranslateTransform(12f, 13f);
}
else
{ {
graphics.TranslateTransform(14f, 17f); sx *= 265f / width;
} }
graphics.TranslateTransform(21f, 23f);
graphics.ScaleTransform(sx, 1f); graphics.ScaleTransform(sx, 1f);
graphics.DrawString(str3, nameFont, nameBrush, 0f, 0f); graphics.DrawString(nametext, nameFont, nameBrush, 0f, 0f);
graphics.DrawString(str3, nameFont, Brushes.Gold, 1f, 1f); graphics.DrawString(nametext, nameFont, Brushes.Gold, 1f, 1f);
graphics.ResetTransform(); graphics.ResetTransform();
return bitmap; return bitmap;
} }
......
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
EncoderParameter parameter = new EncoderParameter(quality, 95L); EncoderParameter parameter = new EncoderParameter(quality, 95L);
encoderParams.Param[0] = parameter; encoderParams.Param[0] = parameter;
string[] files = Directory.GetFiles("./pico", "*.jpg"); string[] files = Directory.GetFiles("./pico", "*.jpg");
Directory.CreateDirectory("./picn/thumbnail"); Directory.CreateDirectory("./picn");
Directory.CreateDirectory("./pics/thumbnail");
foreach (string str in files) foreach (string str in files)
{ {
int code = int.Parse(Path.GetFileNameWithoutExtension(str)); int code = int.Parse(Path.GetFileNameWithoutExtension(str));
...@@ -48,7 +49,8 @@ ...@@ -48,7 +49,8 @@
Console.WriteLine("Generating {0}", fileName); Console.WriteLine("Generating {0}", fileName);
Bitmap image = DataManager.GetImage(code); Bitmap image = DataManager.GetImage(code);
image.Save("./picn/" + fileName, encoderInfo, encoderParams); image.Save("./picn/" + fileName, encoderInfo, encoderParams);
DataManager.Zoom(image, 44, 64).Save("./picn/thumbnail/" + fileName, encoderInfo, encoderParams); DataManager.Zoom(image, 177, 254).Save("./pics/" + fileName, encoderInfo, encoderParams);
DataManager.Zoom(image, 44, 64).Save("./pics/thumbnail/" + fileName, encoderInfo, encoderParams);
image.Dispose(); image.Dispose();
} }
} }
......
textures/att_dark.png

1.12 KB | W: | H:

textures/att_dark.png

2.93 KB | W: | H:

textures/att_dark.png
textures/att_dark.png
textures/att_dark.png
textures/att_dark.png
  • 2-up
  • Swipe
  • Onion skin
textures/att_devine.png

1.1 KB | W: | H:

textures/att_devine.png

3.03 KB | W: | H:

textures/att_devine.png
textures/att_devine.png
textures/att_devine.png
textures/att_devine.png
  • 2-up
  • Swipe
  • Onion skin
textures/att_earth.png

1.03 KB | W: | H:

textures/att_earth.png

2.94 KB | W: | H:

textures/att_earth.png
textures/att_earth.png
textures/att_earth.png
textures/att_earth.png
  • 2-up
  • Swipe
  • Onion skin
textures/att_fire.png

1.13 KB | W: | H:

textures/att_fire.png

2.94 KB | W: | H:

textures/att_fire.png
textures/att_fire.png
textures/att_fire.png
textures/att_fire.png
  • 2-up
  • Swipe
  • Onion skin
textures/att_light.png

1.08 KB | W: | H:

textures/att_light.png

2.92 KB | W: | H:

textures/att_light.png
textures/att_light.png
textures/att_light.png
textures/att_light.png
  • 2-up
  • Swipe
  • Onion skin
textures/att_water.png

1.12 KB | W: | H:

textures/att_water.png

2.87 KB | W: | H:

textures/att_water.png
textures/att_water.png
textures/att_water.png
textures/att_water.png
  • 2-up
  • Swipe
  • Onion skin
textures/att_wind.png

1.13 KB | W: | H:

textures/att_wind.png

2.97 KB | W: | H:

textures/att_wind.png
textures/att_wind.png
textures/att_wind.png
textures/att_wind.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_off_1.png

731 Bytes | W: | H:

textures/link_marker_off_1.png

1.53 KB | W: | H:

textures/link_marker_off_1.png
textures/link_marker_off_1.png
textures/link_marker_off_1.png
textures/link_marker_off_1.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_off_2.png

898 Bytes | W: | H:

textures/link_marker_off_2.png

1.94 KB | W: | H:

textures/link_marker_off_2.png
textures/link_marker_off_2.png
textures/link_marker_off_2.png
textures/link_marker_off_2.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_off_3.png

712 Bytes | W: | H:

textures/link_marker_off_3.png

1.42 KB | W: | H:

textures/link_marker_off_3.png
textures/link_marker_off_3.png
textures/link_marker_off_3.png
textures/link_marker_off_3.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_off_4.png

911 Bytes | W: | H:

textures/link_marker_off_4.png

1.95 KB | W: | H:

textures/link_marker_off_4.png
textures/link_marker_off_4.png
textures/link_marker_off_4.png
textures/link_marker_off_4.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_off_6.png

919 Bytes | W: | H:

textures/link_marker_off_6.png

2.11 KB | W: | H:

textures/link_marker_off_6.png
textures/link_marker_off_6.png
textures/link_marker_off_6.png
textures/link_marker_off_6.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_off_7.png

738 Bytes | W: | H:

textures/link_marker_off_7.png

1.5 KB | W: | H:

textures/link_marker_off_7.png
textures/link_marker_off_7.png
textures/link_marker_off_7.png
textures/link_marker_off_7.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_off_8.png

878 Bytes | W: | H:

textures/link_marker_off_8.png

1.91 KB | W: | H:

textures/link_marker_off_8.png
textures/link_marker_off_8.png
textures/link_marker_off_8.png
textures/link_marker_off_8.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_off_9.png

780 Bytes | W: | H:

textures/link_marker_off_9.png

1.59 KB | W: | H:

textures/link_marker_off_9.png
textures/link_marker_off_9.png
textures/link_marker_off_9.png
textures/link_marker_off_9.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_on_1.png

796 Bytes | W: | H:

textures/link_marker_on_1.png

1.81 KB | W: | H:

textures/link_marker_on_1.png
textures/link_marker_on_1.png
textures/link_marker_on_1.png
textures/link_marker_on_1.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_on_2.png

979 Bytes | W: | H:

textures/link_marker_on_2.png

2.39 KB | W: | H:

textures/link_marker_on_2.png
textures/link_marker_on_2.png
textures/link_marker_on_2.png
textures/link_marker_on_2.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_on_3.png

768 Bytes | W: | H:

textures/link_marker_on_3.png

1.71 KB | W: | H:

textures/link_marker_on_3.png
textures/link_marker_on_3.png
textures/link_marker_on_3.png
textures/link_marker_on_3.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_on_4.png

1009 Bytes | W: | H:

textures/link_marker_on_4.png

2.41 KB | W: | H:

textures/link_marker_on_4.png
textures/link_marker_on_4.png
textures/link_marker_on_4.png
textures/link_marker_on_4.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_on_6.png

1015 Bytes | W: | H:

textures/link_marker_on_6.png

2.59 KB | W: | H:

textures/link_marker_on_6.png
textures/link_marker_on_6.png
textures/link_marker_on_6.png
textures/link_marker_on_6.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_on_7.png

827 Bytes | W: | H:

textures/link_marker_on_7.png

1.81 KB | W: | H:

textures/link_marker_on_7.png
textures/link_marker_on_7.png
textures/link_marker_on_7.png
textures/link_marker_on_7.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_on_8.png

969 Bytes | W: | H:

textures/link_marker_on_8.png

2.38 KB | W: | H:

textures/link_marker_on_8.png
textures/link_marker_on_8.png
textures/link_marker_on_8.png
textures/link_marker_on_8.png
  • 2-up
  • Swipe
  • Onion skin
textures/link_marker_on_9.png

857 Bytes | W: | H:

textures/link_marker_on_9.png

1.91 KB | W: | H:

textures/link_marker_on_9.png
textures/link_marker_on_9.png
textures/link_marker_on_9.png
textures/link_marker_on_9.png
  • 2-up
  • Swipe
  • Onion skin
textures/star.png

464 Bytes | W: | H:

textures/star.png

1.25 KB | W: | H:

textures/star.png
textures/star.png
textures/star.png
textures/star.png
  • 2-up
  • Swipe
  • Onion skin
textures/starb.png

3.14 KB | W: | H:

textures/starb.png

1.23 KB | W: | H:

textures/starb.png
textures/starb.png
textures/starb.png
textures/starb.png
  • 2-up
  • Swipe
  • Onion skin
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