.Net/Winform
C# 선택 영역 색상 반전
동구밖과수원
2012. 10. 29. 14:09
void timer_Tick(object sender, EventArgs e) { if (this.selectedFigure == null) return; using (Graphics g = this.panel_drawPaper.CreateGraphics()) { Global global = Global.GetInstance(); Point point = this.PointToScreen(this.selectedFigure.Location); point =new Point(point.X-2, point.Y-2); Rectangle rect = new Rectangle(point, new Size(global.DrawManager.DrawSize+5, global.DrawManager.DrawSize+5)); ControlPaint.FillReversibleRectangle(rect, Color.Black); } }
ControlPaint Class의 FillReversibleRectangle 메서드를 이용하면 사각 영역의 해당 색상을 반전시키고,
DrawReversibleFrame 메서드는 사각 영역의 라인의 색상만 반전시킨다.