110,571
社区成员
发帖
与我相关
我的任务
分享
public override void Paint(System.Drawing.Graphics g)
{
using (Image image = Image.FromFile(@"switch.png"))
{
using (TextureBrush brush = new TextureBrush(image)) {
brush.TranslateTransform(rectangle.X, rectangle.Y);
g.FillRectangle(brush, rectangle.X, rectangle.Y, image.Width, image.Height);
//g.Restore(state);
}
}
}