コード例 #1
0
        public NotificationCanvas(int width, int height, Schedule schedule)
        {
            this.Width  = width;
            this.Height = height;

            this.Image = new Bitmap(width, height);

            this.Padding = new ThickEdge(15);

            using (var graphics = Graphics.FromImage(this.Image))
            {
                this.DrawBackground(graphics);
                this.DrawModernBorder(graphics);
            }

            var schedulePrinter = new SchedulePrinter();

            schedulePrinter.Print(schedule, this.Image, this.Padding);
        }
コード例 #2
0
        public NotificationCanvas(int width, int height, string text = null)
        {
            this.Width  = width;
            this.Height = height;

            this.Image = new Bitmap(width, height);

            this.Padding = new ThickEdge();

            using (var graphics = Graphics.FromImage(this.Image))
            {
                this.DrawBackground(graphics);
                this.DrawModernBorder(graphics);

                if (!string.IsNullOrWhiteSpace(text))
                {
                    this.DrawText(graphics, text);
                }
            }
        }