首页 > 解决方案 > 绘制节点图形绘制 C#

问题描述

编辑:我如何激活滚动条并在滚动后保持我的绘图,如 Paint 应用程序。如您所见,我正在客户端矩形之外绘制一个半径为 25px 的圆,但我无法滚动。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Nodes
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            InitializeComponent();
            this.DoubleBuffered = true;
            this.AutoScroll = true;
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            g.DrawEllipse(Pens.Black, new Rectangle(0,this.ClientRectangle.Bottom, 50,50));
        }


    }
}

标签: c#scrollgraphicsdrawingshape-outside

解决方案


推荐阅读