/// <summary> /// Rendert ein Match /// </summary> /// <param name="oMatch"></param> public void Render(Model.Database.Match oMatch) { Model.Database.Week oWeek; Model.Database.Region oRegion; Image oImage; Graphics oGraphics; string cWeekDirectoryPath; string cMatchFilePath; string cFehler = string.Empty; try { //Directory Checks //--------------------------------------------------------------------------------------------------------- oWeek = m_oLstWeeks.Single(x => x.ID == oMatch.WEEK_ID); oRegion = m_oLstRegionen.Single(x => x.ID == oWeek.REGION_ID); cWeekDirectoryPath = Path.Combine(APP_CONFIG["OUTPUT_PATH"], string.Format("{0}_{1:d}-{2:d}", oRegion.NAME, oWeek.START_TIME, oWeek.END_TIME)); if (!Directory.Exists(cWeekDirectoryPath)) { Directory.CreateDirectory(cWeekDirectoryPath); } cMatchFilePath = Path.Combine(cWeekDirectoryPath, string.Format("{0}_{1}-{2}-{3}.png", oMatch.ANET_ID.Replace("-", "."), m_oDictWelten[oMatch.GREEN_WORLD_ID].NAME.Split('[')[0].Trim().Replace("'", ""), m_oDictWelten[oMatch.BLUE_WORLD_ID].NAME.Split('[')[0].Trim().Replace("'", ""), m_oDictWelten[oMatch.RED_WORLD_ID].NAME.Split('[')[0].Trim().Replace("'", ""))); oImage = Image.FromFile(APP_CONFIG["TEMPLATE_PATH"]); oGraphics = Graphics.FromImage(oImage); oGraphics.SmoothingMode = SmoothingMode.AntiAlias; oGraphics.InterpolationMode = InterpolationMode.High; oGraphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; //Header //--------------------------------------------------------------------------------------------------------- cFehler += RenderHeader(ref oImage, ref oGraphics, oMatch, oWeek); //Matchup //--------------------------------------------------------------------------------------------------------- cFehler += RenderMatchupFinal(ref oImage, ref oGraphics, oMatch, oWeek); //SMC //--------------------------------------------------------------------------------------------------------- cFehler += RenderSMC(ref oImage, ref oGraphics, oMatch, oWeek); //Keepcrusher //--------------------------------------------------------------------------------------------------------- cFehler += RenderKeepcrusher(ref oImage, ref oGraphics, oMatch, oWeek); //Camps //--------------------------------------------------------------------------------------------------------- cFehler += RenderCampSupremacy(ref oImage, ref oGraphics, oMatch, oWeek); //Battle //--------------------------------------------------------------------------------------------------------- cFehler += RenderInBattle(ref oImage, ref oGraphics, oMatch, oWeek); //Gilden //--------------------------------------------------------------------------------------------------------- cFehler += RenderGuilds(ref oImage, ref oGraphics, oMatch, oWeek); //Tick //--------------------------------------------------------------------------------------------------------- cFehler += RenderTick(ref oImage, ref oGraphics, oMatch, oWeek); //BLoodlust //--------------------------------------------------------------------------------------------------------- cFehler += RenderBloodlust(ref oImage, ref oGraphics, oMatch, oWeek); if (cFehler.Length == 0) { oImage.Save(cMatchFilePath, System.Drawing.Imaging.ImageFormat.Png); } else { MessageBox.Show("Fehler bei " + oMatch.ToValueString()); } SetLoadingLabelCurrents("Saved.", 9, ANZ_SCHRITTE); } catch (Exception oEx) { LOGWRITER.WriteMessage(oEx.ToString(), LogWriter.MESSAGE_TYPE.Error); } }