我的代码错在哪里了
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;namespace WindowsApplication1
{
public partial class Form6_Region类 : Form
{
public Form6_Region类()
{
InitializeComponent();
} private void Form6_Region类_Paint(object sender, PaintEventArgs e)
{
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics g = e.Graphics;
Rectangle rect1=new Rectangle(10,10,100,100);
Rectangle rect2=new Rectangle(40,3,100,100);
Region reg1 = new Region(rect1);
Region reg2 = new Region(rect2);
g.FillRegion(new SolidBrush(Color.Red),reg1);
g.FillRegion(new SolidBrush(Color.Yellow), reg2);
reg1.Intersect(reg2);
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;namespace WindowsApplication1
{
public partial class Form6_Region类 : Form
{
public Form6_Region类()
{
InitializeComponent();
} private void Form6_Region类_Paint(object sender, PaintEventArgs e)
{
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics g = e.Graphics;
Rectangle rect1=new Rectangle(10,10,100,100);
Rectangle rect2=new Rectangle(40,3,100,100);
Region reg1 = new Region(rect1);
Region reg2 = new Region(rect2);
g.FillRegion(new SolidBrush(Color.Red),reg1);
g.FillRegion(new SolidBrush(Color.Yellow), reg2);
reg1.Intersect(reg2);
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货