예제 #1
0
        private Color fontColor = Color.White; //TODO 重构这玩意 getter/setter


        public MainForm()
        {
            InitializeComponent();
            Font  font  = new Font("微软雅黑", 14);
            Brush brush = Brushes.White;

            painter = new FontPainter(font, 400, 400);

            picboxColor.BackColor = fontColor;

            this.Characters = new List <char>(300);
            AddChars(Character.ENGLISH_CHARS);
        }
예제 #2
0
        public PreviewForm(FontPainter painter)
        {
            InitializeComponent();

            //设置图片
            this.painter      = painter;
            image             = painter.GetImage();
            imageSize         = new Size(image.Width, image.Height);
            pictureBox1.Image = Image.FromHbitmap(painter.GetImage().GetHbitmap());

            //调整图片框大小
            pictureBox1.Size = pictureBox1.Image.Size;

            //设置滚动条
            hScrollBar1.Maximum = pictureBox1.Image.Width - panel1.Width;
            vScrollBar1.Maximum = pictureBox1.Image.Height - panel1.Height;
        }