我正在尝试使用在方法外部创建的私有位图在方法中创建新的位图,但它抛出的参数无效错误。我是C#的新手,所以任何人都可以进行扫描,看看我做错了什么?感谢
private Bitmap picture;
private Graphics g1;
private Cursor c1, c2;
public HSBColor HSBcol = new HSBColor();
Pen p = new Pen(Color.Red, 2);
public Form1()
{
InitializeComponent();
init();
start();
mandelbrot();
}
public void init() // all instances will be prepared
{
finished = false;
x1 = this.Location.X;
y1 = this.Location.Y;
xy = (float)x1 / (float)y1;
picture = new Bitmap(x1, y1);
g1 = Graphics.FromImage(picture);
finished = true;
}