示例#1
0
        public override System.Drawing.Bitmap drawTextOnImage(SmashOverlayGenerator form)
        {
            //IF FONT IS NOT INSTALLED WE INSTALL IT

            GenFcns.installFonts(form, "EARTHQUAKE.TTF", pfc);
            GenFcns.installFonts(form, "FLAPHEAD.TTF", pfc);

            //fontsInstalled(form, "EARTHQUAKE");
            //fontsInstalled(form, "FLAPHEAD");
            //fontsInstalled(form, "zekton rg");

            setFontSizes(form.ResourceType, form.MatchupCompetitor1, form.MatchupCompetitor2);
            if (!GenFcns.isNullOrEmpty(Gametype) && Gametype.Equals("doubles"))
            {
                setFontSizes(form.ResourceType, Competitor3, Competitor4);
            }

            TournamentName  = form.TournamentName;
            TournamentRound = form.TournamentRound;
            Competitor1     = form.MatchupCompetitor1;
            Competitor2     = form.MatchupCompetitor2;

            StringFormat nameFormat       = new StringFormat();
            StringFormat tournamentFormat = new StringFormat();
            Bitmap       image            = base.getImage();
            Graphics     g = Graphics.FromImage(image);

            nameFormat.LineAlignment   = StringAlignment.Center;
            nameFormat.Alignment       = StringAlignment.Center;
            tournamentFormat.Alignment = StringAlignment.Center;

            //DRAW CHARACTERS
            drawCharactersOnImage(g, Character1Path, Character1Point, Character2Path, Character2Point);


            //DRAW BANNER
            Pen        p       = new Pen(Color.LightCyan, (float)50.0);
            SolidBrush b       = new SolidBrush(Color.MediumPurple);
            SolidBrush bBorder = new SolidBrush(Color.White);
            Rectangle  r       = new Rectangle(new Point(0, 800), new Size(1920, 200));
            Rectangle  rBorder = new Rectangle(new Point(0, 780), new Size(1920, 240));

            g.FillRectangle(bBorder, rBorder);
            g.FillRectangle(b, r);

            FontFamily earthquakeFamily = pfc.Families[0];
            FontFamily flapheadFamily   = pfc.Families[1];
            Font       earthquake       = new Font(earthquakeFamily, 120);
            Font       flaphead         = new Font(flapheadFamily, 120);

            //DRAW COMPETITOR INFORMATION
            g.DrawString(form.MatchupCompetitor1, earthquake, Brushes.White, Competitor1Point.getPoint(), nameFormat);
            g.DrawString(form.MatchupCompetitor2, earthquake, Brushes.White, Competitor2Point.getPoint(), nameFormat);
            //g.DrawString("THIS IS A TEST", f1, Brushes.Yellow, new Point(0, 0), nameFormat);
            //g.DrawString(form.TournamentName, TournamentFont, Brushes.White, TournamentPoint.getPoint(), tournamentFormat);


            //DRAW TOURNAMENT STUFFS
            string tournamentLogoPath = ListBoxFcns.getResourcePath(form.ProductName, "tournament", "*****@*****.**");
            Image  logoImage          = base.getImage(tournamentLogoPath);

            g.DrawImage(logoImage, TournamentPoint.getPoint());
            g.DrawString(form.TournamentRound, flaphead, Brushes.White, TournamentRoundPoint.getPoint(), tournamentFormat);


            Image  img      = (Image)image;
            Bitmap newImage = new Bitmap(img, new Size(640, 400));

            return(newImage);
        }