Beispiel #1
0
        public async Task sonicsays([Remainder] string text)
        {
            var readSettings = new MagickReadSettings
            {
                TextEncoding    = Encoding.Unicode,
                FontFamily      = PictureService.GetBestFont(text),
                FontStyle       = FontStyleType.Bold,
                FillColor       = MagickColors.White,
                BackgroundColor = MagickColors.Black,
                Width           = 980,
                Height          = 624
            };

            PictureService.AnnotateImage(Context, "sonicsaystemplate", text, readSettings, MagickColors.Black, 41, 93, 539, 93, 41, 406, 539, 406);
            //System.Drawing.Image backing = System.Drawing.Image.FromFile(Environment.CurrentDirectory + "\\Content\\sonicsaystemplate.png");
            //Graphics canvas = Graphics.FromImage(backing);
            //Rectangle r = new Rectangle(new Point(44, 112), new Size(514, 291));
            //StringFormat s = new StringFormat();
            //s.Alignment = StringAlignment.Near;
            //s.LineAlignment = StringAlignment.Center;
            //canvas.DrawString(text, new Font(FontFamily.GenericSansSerif, 50), Brushes.White, r, s);
            //MemoryStream outgoing = new MemoryStream();
            //canvas.Save();
            //backing.Save(outgoing, System.Drawing.Imaging.ImageFormat.Png);
            //outgoing.Seek(0, SeekOrigin.Begin);
            //return Context.Channel.SendFileAsync(outgoing, "sonicsays.png");
        }
Beispiel #2
0
        public async Task ChangeMyMind([Remainder] string text)
        {
            var readSettings = new MagickReadSettings
            {
                TextEncoding    = Encoding.Unicode,
                FontFamily      = PictureService.GetBestFont(text),
                FontStyle       = FontStyleType.Bold,
                FillColor       = MagickColors.Black,
                BackgroundColor = MagickColors.White,
                Width           = 980,
                Height          = 624
            };

            PictureService.AnnotateImage(Context, "cmm", text, readSettings, MagickColors.White, 242, 352, 526, 236, 292, 474, 576, 358);
        }