protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; g.InterpolationMode = InterpolationMode.NearestNeighbor; var entity = Connector.SelectedImage;//获得当前选择的贴图 var pos = CurrentLayer.Location; if (!Config["MultipleLayer"].Boolean && entity?.Picture != null) { if (entity.Type == ColorBits.LINK && entity.Target != null) { entity = entity.Target; } var pictrue = entity.Picture; var size = entity.Size.Star(Config["CanvasScale"].Decimal); if (Config["LinearDodge"].Boolean) { pictrue = pictrue.LinearDodge(); } if (Config["OnionSkin"].Boolean) { LastLayer?.Draw(g); } CurrentLayer.Tag = entity; CurrentLayer.Size = size; //校正当前图层的宽高 CurrentLayer.Image = pictrue; //校正贴图 CurrentLayer.Draw(g); //绘制贴图 } }