36 var imgDir = Path.Combine(wwwrootPath,
"img");
37 var outPath = Path.Combine(imgDir,
"og-platform.png");
39 if (File.Exists(outPath))
return;
41 Directory.CreateDirectory(imgDir);
43 const int W = 1200, H = 630;
44 using var bmp =
new Bitmap(W, H, PixelFormat.Format32bppArgb);
45 using var g = Graphics.FromImage(bmp);
46 g.SmoothingMode = SmoothingMode.AntiAlias;
47 g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
50 using (var bgBrush =
new LinearGradientBrush(
51 new Point(0, 0),
new Point(W, H),
52 Color.FromArgb(255, 147, 51),
53 Color.FromArgb(251, 191, 36)))
55 g.FillRectangle(bgBrush, 0, 0, W, H);
59 DrawCircle(g, -100, -100, 380, Color.FromArgb(30, 255, 255, 255));
60 DrawCircle(g, 900, 380, 420, Color.FromArgb(20, 255, 255, 255));
61 DrawCircle(g, 980, -80, 180, Color.FromArgb(25, 255, 255, 255));
62 DrawCircle(g, 40, 430, 220, Color.FromArgb(20, 255, 255, 255));
63 DrawCircle(g, 500, -60, 140, Color.FromArgb(15, 255, 255, 255));
66 var cardRect =
new RectangleF(160, 90, 880, 450);
68 Color.FromArgb(210, 255, 255, 255),
69 Color.FromArgb(60, 255, 255, 255), 2f);
72 using var iconFont =
new Font(
"Segoe UI Emoji", 56, FontStyle.Regular, GraphicsUnit.Pixel);
73 DrawCenteredText(g,
"👨👩👧👦", iconFont, Color.FromArgb(60, 40, 20), W / 2f, 198);
76 using var titleFont =
new Font(
"맑은 고딕", 50, FontStyle.Bold, GraphicsUnit.Pixel);
77 DrawCenteredText(g,
"무료 가족 앨범", titleFont, Color.FromArgb(45, 28, 8), W / 2f, 295);
80 using var subFont =
new Font(
"맑은 고딕", 22, FontStyle.Regular, GraphicsUnit.Pixel);
82 Color.FromArgb(90, 60, 20), W / 2f, 360);
85 using var linePen =
new Pen(Color.FromArgb(80, 255, 200, 100), 1.5f);
86 g.DrawLine(linePen, 400, 394, 800, 394);
89 var badgeRect =
new RectangleF(440, 410, 320, 44);
90 using var badgeBrush =
new SolidBrush(Color.FromArgb(220, 249, 115, 22));
92 using var badgeFont =
new Font(
"맑은 고딕", 18, FontStyle.Bold, GraphicsUnit.Pixel);
96 using var domFont =
new Font(
"Arial", 18, FontStyle.Regular, GraphicsUnit.Pixel);
98 Color.FromArgb(100, 45, 28, 8), W / 2f, 503);
101 bmp.Save(outPath, ImageFormat.Png);