コード例 #1
0
        private string DrawAndSaveTags(List <Tuple <string, Rectangle> > tags, FontFamily fontFamily, Color stringColor)
        {
            var path = creator.GetNewPngPath();

            using (var bitmap = new Bitmap(canvas.Width, canvas.Height))
                using (var graphics = Graphics.FromImage(bitmap))
                {
                    backgroundPainter.Draw(tags, canvas, graphics);
                    DrawAllStrings(tags, fontFamily, stringColor, graphics);

                    bitmap.Save(path);
                }
            return(path);
        }
コード例 #2
0
        public string Visualize(string filename, FontFamily fontFamily, Color stringColor)
        {
            var bitmap   = new Bitmap(canvas.Width, canvas.Height);
            var graphics = Graphics.FromImage(bitmap);
            var tags     = tagsCreater.GetTags(filename, canvas.Height);

            backgroundPainter.Draw(tags, canvas, graphics);
            DrawAllStrings(tags, fontFamily, stringColor, graphics);

            var path = creater.GetNewPngPath();

            bitmap.Save(path);
            return(path);
        }