public void GenerateImage(Link link, string faction1, string faction2, string offensiveFaction) { var fileName = link.GetFileName(Galaxy, faction1, faction2, offensiveFaction); var linkDrawing = GetLinkDrawing(link, faction1, faction2, offensiveFaction); if (linkDrawing != null && !File.Exists(fileName)) { var bitmapSize = GetImageBounds(link).Size.Multiply(AntiAliasFactor); using (var bitmap = new Bitmap(bitmapSize.Width, bitmapSize.Height)) { var location = new Point(Padding*AntiAliasFactor, Padding*AntiAliasFactor); using (var g = Graphics.FromImage(bitmap)) { SetHighQuality(g); linkDrawing.Draw(g, location, MapSize.Multiply(AntiAliasFactor)); } bitmap.HighQualityResize(1/(float)AntiAliasFactor).Save( Path.Combine(ImagePath, fileName), ImageFormat); } } }
public void GetFileName2() { var link = new Link(0, 2); Assert.AreEqual("0_2_Arm_neutral_.png", link.GetFileName(galaxy)); }
public void GetFileName3() { var link = new Link(3, 2); Assert.AreEqual("3_2_neutral_neutral_.png", link.GetFileName(galaxy)); }
public void GetFileName1() { var link = new Link(0, 1); Assert.AreEqual("0_1_Arm_Core_Arm.png", link.GetFileName(galaxy)); }