private void Picture_Paint(object sender, PaintEventArgs e) { ViewBuffer buffer = new ViewBuffer(); buffer.CreateGraphics(pb.Width, pb.Height); Graphics g = buffer.g; if (selected) { SolidBrush basicBrushes = new SolidBrush(Color.FromArgb(170, 234, 202, 233)); g.FillRectangle(basicBrushes, 0, 0, Width, Height); } else if (mouse_enter) { SolidBrush basicBrushes = new SolidBrush(Color.FromArgb(100, 234, 202, 233)); g.FillRectangle(basicBrushes, 0, 0, Width, Height); } g.SmoothingMode = SmoothingMode.HighQuality; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; if (callfrom_panel == false) { callfrom_paint = true; Invalidate(); } callfrom_panel = false; buffer.Draw(e.Graphics); buffer.Dispose(); }
private void Picture_Paint(object sender, PaintEventArgs e) { ViewBuffer buffer = new ViewBuffer(); buffer.CreateGraphics(pb.Width, pb.Height); Graphics g = buffer.g; if (downloaded == false) { if (selected) { SolidBrush basicBrushes = new SolidBrush(Color.FromArgb(170, 234, 202, 233)); g.FillRectangle(basicBrushes, 0, 0, Width, Height); } else if (mouse_enter) { SolidBrush basicBrushes = new SolidBrush(Color.FromArgb(100, 234, 202, 233)); g.FillRectangle(basicBrushes, 0, 0, Width, Height); } } else { if (downloading) { SolidBrush basicBrushes = new SolidBrush(Color.FromArgb(200, 200, 200, 0)); g.FillRectangle(basicBrushes, 0, 0, Width, Height); } else { SolidBrush basicBrushes = new SolidBrush(Color.FromArgb(200, 200, 130, 130)); g.FillRectangle(basicBrushes, 0, 0, Width, Height); } } if (callfrom_panel == false) { callfrom_paint = true; Invalidate(); } callfrom_panel = false; buffer.Draw(e.Graphics); buffer.Dispose(); }
public void Render(Graphics g, Size sizeOfPannel, Point mousePosition, float scale = 1.0F, List <FixedString> fixedString = null) { vb.CreateGraphics(sizeOfPannel.Width, sizeOfPannel.Height); vb.g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; vb.g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; /* 확대 축소 변환 */ vb.g.ScaleTransform(scale, scale); /* 원점을 마우스 표시 지점에 따라 이동 */ vb.g.TranslateTransform(bp.X, bp.Y); sizeOfPannel = new Size((int)(sizeOfPannel.Width / scale), (int)(sizeOfPannel.Height / scale)); /// /// 그리기 메인부 [!-- //DrawGrid(vb.g, sizeOfPannel, Color.FromArgb(150, 150, 255)); RenderEdge(vb.g, sizeOfPannel, mousePosition); HighlightEdge(vb.g, sizeOfPannel); RenderVertex(vb.g, sizeOfPannel, mousePosition); DrawStayedString(vb.g, scale); DrawStayedSelectionString(vb.g, scale); /// --!] /// /* 원점을 제자리로 되돌림 */ vb.g.TranslateTransform(-bp.X, -bp.Y); /// /// 고정 오브젝트 그리기 메인부 [!-- DrawEdge(vb.g, sizeOfPannel, Color.FromArgb(150, 255, 150)); DrawFixedText(vb.g, fixedString); if (drawdragbox) { DrawDragBox(vb.g); } /// --!] /// vb.Draw(g); }
private void Picture_Paint(object sender, PaintEventArgs e) { ViewBuffer buffer = new ViewBuffer(); buffer.CreateGraphics(pb.Width, pb.Height); Graphics g = buffer.g; if (downloaded == false) { if (selected) { SolidBrush basicBrushes = new SolidBrush(Color.FromArgb(170, 234, 202, 233)); g.FillRectangle(basicBrushes, 0, 0, Width, Height); } else if (mouse_enter) { SolidBrush basicBrushes = new SolidBrush(Color.FromArgb(100, 234, 202, 233)); g.FillRectangle(basicBrushes, 0, 0, Width, Height); } } else { if (downloading) { SolidBrush basicBrushes = new SolidBrush(Color.FromArgb(200, 200, 200, 0)); g.FillRectangle(basicBrushes, 0, 0, Width, Height); } else { SolidBrush basicBrushes = new SolidBrush(Color.FromArgb(200, 200, 130, 130)); g.FillRectangle(basicBrushes, 0, 0, Width, Height); } } g.SmoothingMode = SmoothingMode.HighQuality; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; float star_position = 2; if (downloaded_overlapping) { g.DrawString("★", new Font(font.FontFamily, 12), Brushes.Orange, new PointF(star_position, 2)); star_position += 6; } if (hidden_data) { g.DrawString("★", new Font(font.FontFamily, 12), Brushes.SkyBlue, new PointF(star_position, 2)); star_position += 6; } if (bookmark) { g.DrawString("★", new Font(font.FontFamily, 12), Brushes.OrangeRed, new PointF(star_position, 2)); } if (callfrom_panel == false) { callfrom_paint = true; Invalidate(); } callfrom_panel = false; buffer.Draw(e.Graphics); buffer.Dispose(); }