public void DrawRectangle(Rect theRect, ILineStyleInfo theStyle) { GDILineStyle Style = (GDILineStyle)theStyle; IntPtr hPen = API.CreatePen(0, theStyle.Width, Style.Win32ForeColor); IntPtr hOldPen = API.SelectObject(hDC, hPen); IntPtr hBrush = API.GetStockObject(5); // NULL_BRUSH IntPtr hOldBrush = API.SelectObject(hDC, hBrush); API.Rectangle(hDC, theRect.Location.X, theRect.Location.Y, theRect.Right, theRect.Bottom); API.SelectObject(hDC, hOldBrush); API.SelectObject(hDC, hOldPen); API.DeleteObject(hPen); // int hPen = API.CreatePen(0, theStyle.Width, theStyle.Win32ForeColor); // int hOldPen = API.SelectObject(hDC, hPen); // // int left = theRect.Location.X; // int top = theRect.Location.Y; // int right = theRect.Right; // int bottom = theRect.Bottom; // // API.MoveToEx(hDC, left, top, ref NULLPOINTAPI); // API.LineTo(hDC, right, top); // API.LineTo(hDC, right, bottom); // API.LineTo(hDC, left, bottom); // API.LineTo(hDC, left, top); // // API.SelectObject(hDC, hOldPen); // API.DeleteObject(hPen); }
public void FillPolygon(IList <Point> Points, ILineStyleInfo LineStyle, IFillStyleInfo FillStyle) { GDILineStyle Line = (GDILineStyle)LineStyle; GDIFillStyle Fill = (GDIFillStyle)FillStyle; API.POINT[] P = new API.POINT[Points.Count]; for (int i = 0; i < Points.Count; i++) { P[i].x = Points[i].X; P[i].y = Points[i].Y; } SetPenBrush(Line.ForeColor, Line.Width, Fill.FillColor); //IntPtr hPen = API.CreatePen(0, Line.Width, Line.Win32ForeColor); //IntPtr hOldPen = API.SelectObject(hDC, hPen); //IntPtr hBrush = API.CreateSolidBrush(Fill.Win32FillColor); //IntPtr hOldBrush = API.SelectObject(hDC, hBrush); API.Polygon(hDC, P, Points.Count); ResetPenBrush(); //API.SelectObject(hDC, hOldBrush); //API.DeleteObject(hBrush); //API.SelectObject(hDC, hOldPen); //API.DeleteObject(hPen); }
public void DrawFilledRectangle(Rect theRect, ILineStyleInfo Line, IFillStyleInfo Fill) { GDILineStyle LineStyle = (GDILineStyle)Line; GDIFillStyle FillStyle = (GDIFillStyle)Fill; if (FillStyle.Mode != GuiLabs.Canvas.DrawStyle.FillMode.Solid) { GradientFillRectangle( theRect, FillStyle.FillColor, FillStyle.GradientColor, FillStyle.Mode == GuiLabs.Canvas.DrawStyle.FillMode.HorizontalGradient ? System.Drawing.Drawing2D.LinearGradientMode.Horizontal : LinearGradientMode.Vertical); DrawRectangle(theRect, Line); return; } IntPtr hPen = API.CreatePen(0, Line.Width, LineStyle.Win32ForeColor); IntPtr hOldPen = API.SelectObject(hDC, hPen); IntPtr hBrush = API.CreateSolidBrush(FillStyle.Win32FillColor); IntPtr hOldBrush = API.SelectObject(hDC, hBrush); API.Rectangle(hDC, theRect.Location.X, theRect.Location.Y, theRect.Right, theRect.Bottom); API.SelectObject(hDC, hOldBrush); API.DeleteObject(hBrush); API.SelectObject(hDC, hOldPen); API.DeleteObject(hPen); }
public override void DrawLine(int x1, int y1, int x2, int y2, ILineStyleInfo theStyle) { P1.Set(x1, y1); P2.Set(x2, y2); TransformPoint(P1, P1); TransformPoint(P2, P2); SourceDrawOperations.DrawLine(P1.X, P1.Y, P2.X, P2.Y, theStyle); }
public static Paint CreatePaintFromStyleInfo(ILineStyleInfo styleInfo) { var paint = new Paint(PaintFlags.AntiAlias); paint.StrokeWidth = styleInfo.StrokeWidth; paint.Alpha = 100; paint.Color = CreateColor(styleInfo.StrokeColor); paint.SetStyle(GetLineStyle(styleInfo.LineType)); return paint; }
static ScrollbarFactory() { BackgroundStyle = RendererSingleton.StyleFactory.ProduceNewFillStyleInfo(System.Drawing.Color.WhiteSmoke); BorderStyle = RendererSingleton.StyleFactory.ProduceNewLineStyleInfo(System.Drawing.Color.WhiteSmoke, 1); ButtonUpStyle = new ArrowButtonStyle(ArrowButtonStyle.ArrowType.Up); ButtonDownStyle = new ArrowButtonStyle(ArrowButtonStyle.ArrowType.Down); ButtonLeftStyle = new ArrowButtonStyle(ArrowButtonStyle.ArrowType.Left); ButtonRightStyle = new ArrowButtonStyle(ArrowButtonStyle.ArrowType.Right); MyThumbStyle = new ScrollbarButtonStyle(); }
public static Paint CreatePaintFromStyleInfo(ILineStyleInfo styleInfo) { var paint = new Paint(PaintFlags.AntiAlias); paint.StrokeWidth = styleInfo.StrokeWidth; paint.Alpha = 100; paint.Color = CreateColor(styleInfo.StrokeColor); paint.SetStyle(GetLineStyle(styleInfo.LineType)); return(paint); }
public override void DrawLine(int x1, int y1, int x2, int y2, ILineStyleInfo theStyle) { GDILineStyle Style = (GDILineStyle)theStyle; IntPtr hPen = API.CreatePen(0, theStyle.Width, Style.Win32ForeColor); IntPtr hOldPen = API.SelectObject(hDC, hPen); API.MoveToEx(hDC, x1, y1, ref NULLPOINT); API.LineTo(hDC, x2, y2); API.SelectObject(hDC, hOldPen); API.DeleteObject(hPen); }
public void DrawLine(Point p1, Point p2, ILineStyleInfo theStyle) { GDILineStyle Style = (GDILineStyle)theStyle; IntPtr hPen = API.CreatePen(0, theStyle.Width, Style.Win32ForeColor); IntPtr hOldPen = API.SelectObject(hDC, hPen); API.MoveToEx(hDC, p1.X, p1.Y, ref NULLPOINT); API.LineTo(hDC, p2.X, p2.Y); API.SelectObject(hDC, hOldPen); API.DeleteObject(hPen); }
public void FillPolygon(IList <Point> Points, ILineStyleInfo LineStyle, IFillStyleInfo FillStyle) { GDIPlusLineStyle Line = (GDIPlusLineStyle)LineStyle; GDIPlusFillStyle Fill = (GDIPlusFillStyle)FillStyle; System.Drawing.Point[] P = new System.Drawing.Point[Points.Count]; for (int i = 0; i < Points.Count; i++) { P[i].X = Points[i].X; P[i].Y = Points[i].Y; } mGraphics.FillPolygon(Fill.Brush, P); mGraphics.DrawPolygon(Line.Pen, P); }
public void DrawFilledEllipse(Rect theRect, ILineStyleInfo Line, IFillStyleInfo Fill) { GDILineStyle LineStyle = (GDILineStyle)Line; GDIFillStyle FillStyle = (GDIFillStyle)Fill; IntPtr hPen = API.CreatePen(0, Line.Width, LineStyle.Win32ForeColor); IntPtr hOldPen = API.SelectObject(hDC, hPen); IntPtr hBrush = API.CreateSolidBrush(FillStyle.Win32FillColor); IntPtr hOldBrush = API.SelectObject(hDC, hBrush); API.Ellipse(hDC, theRect.Location.X, theRect.Location.Y, theRect.Right, theRect.Bottom); API.SelectObject(hDC, hOldBrush); API.DeleteObject(hBrush); API.SelectObject(hDC, hOldPen); API.DeleteObject(hPen); }
public void DrawEllipse(Rect theRect, ILineStyleInfo theStyle) { GDILineStyle Style = theStyle as GDILineStyle; if (Style == null) { Log.Instance.WriteWarning("DrawEllipse: Style == null"); return; } IntPtr hPen = API.CreatePen(0, theStyle.Width, Style.Win32ForeColor); IntPtr hOldPen = API.SelectObject(hDC, hPen); IntPtr hBrush = API.GetStockObject(5); // NULL_BRUSH IntPtr hOldBrush = API.SelectObject(hDC, hBrush); API.Ellipse(hDC, theRect.Location.X, theRect.Location.Y, theRect.Right, theRect.Bottom); API.SelectObject(hDC, hOldBrush); API.SelectObject(hDC, hOldPen); API.DeleteObject(hPen); }
protected override void DrawBorder(IRenderer Renderer) { if (this.State == ButtonState.Normal) { TopLeft = LightBorder; BottomRight = this.CurrentStyle.LineStyleInfo; } else { TopLeft = this.CurrentStyle.LineStyleInfo; BottomRight = LightBorder; } Rect R = this.Bounds; int x1 = R.Location.X; int y1 = R.Location.Y; int x2 = R.Right - 1; int y2 = R.Bottom - 1; Renderer.DrawOperations.DrawLine(x1, y1, x2, y1, TopLeft); Renderer.DrawOperations.DrawLine(x1, y1, x1, y2, TopLeft); Renderer.DrawOperations.DrawLine(x2, y1, x2, y2, BottomRight); Renderer.DrawOperations.DrawLine(x1, y2, x2 + 1, y2, BottomRight); }
public abstract void DrawLine(int x1, int y1, int x2, int y2, ILineStyleInfo theStyle);
public void DrawEllipse(Rect theRect, ILineStyleInfo theStyle) { TransformRect(theRect); SourceDrawOperations.DrawEllipse(R, theStyle); }
public void DrawFilledEllipse(Rect theRect, ILineStyleInfo Line, IFillStyleInfo Fill) { TransformRect(theRect); SourceDrawOperations.DrawFilledEllipse(R, Line, Fill); }
public void FillPolygon(IList<Point> Points, ILineStyleInfo LineStyle, IFillStyleInfo FillStyle) { GDIPlusLineStyle Line = (GDIPlusLineStyle)LineStyle; GDIPlusFillStyle Fill = (GDIPlusFillStyle)FillStyle; System.Drawing.Point[] P = new System.Drawing.Point[Points.Count]; for (int i = 0; i < Points.Count; i++) { P[i].X = Points[i].X; P[i].Y = Points[i].Y; } mGraphics.FillPolygon(Fill.Brush, P); mGraphics.DrawPolygon(Line.Pen, P); }
public void DrawFilledRectangle(Rect theRect, ILineStyleInfo Line, IFillStyleInfo Fill) { FillRectangle(theRect, Fill); DrawRectangle(theRect, Line); }
public void DrawLine(int x1, int y1, int x2, int y2, ILineStyleInfo theStyle) { DrawLine(x1, y1, x2, y2, theStyle.ForeColor, theStyle.Width); }
public override void DrawLine(int x1, int y1, int x2, int y2, ILineStyleInfo theStyle) { mGraphics.DrawLine(((GDIPlusLineStyle)theStyle).Pen, x1, y1, x2, y2); }
public void DrawLine(Point p1, Point p2, ILineStyleInfo theStyle) { DrawLine(p1.X, p1.Y, p2.X, p2.Y, theStyle.ForeColor, theStyle.Width); }
public void DrawFilledEllipse(Rect theRect, ILineStyleInfo Line, IFillStyleInfo Fill) { FillEllipse(theRect, Fill.FillColor); DrawEllipse(theRect, Line); }
// ===================================================================== public void DrawRectangle(Rect theRect, ILineStyleInfo theStyle) { mGraphics.DrawRectangle(((GDIPlusLineStyle)theStyle).Pen, theRect.GetRectangle()); }
public void FillPolygon(IList<Point> Points, ILineStyleInfo LineStyle, IFillStyleInfo FillStyle) { GDILineStyle Line = (GDILineStyle)LineStyle; GDIFillStyle Fill = (GDIFillStyle)FillStyle; API.POINT[] P = new API.POINT[Points.Count]; for (int i = 0; i < Points.Count; i++) { P[i].x = Points[i].X; P[i].y = Points[i].Y; } IntPtr hPen = API.CreatePen(0, Line.Width, Line.Win32ForeColor); IntPtr hOldPen = API.SelectObject(hDC, hPen); IntPtr hBrush = API.CreateSolidBrush(Fill.Win32FillColor); IntPtr hOldBrush = API.SelectObject(hDC, hBrush); API.Polygon(hDC, ref P[0], Points.Count); API.SelectObject(hDC, hOldBrush); API.DeleteObject(hBrush); API.SelectObject(hDC, hOldPen); API.DeleteObject(hPen); }
public void FillPolygon(IList<Point> Points, ILineStyleInfo LineStyle, IFillStyleInfo FillStyle) { TransformPointList(Points); SourceDrawOperations.FillPolygon(Points, LineStyle, FillStyle); }
public void DrawLine(GuiLabs.Canvas.Point p1, GuiLabs.Canvas.Point p2, ILineStyleInfo theStyle) { mGraphics.DrawLine(((GDIPlusLineStyle)theStyle).Pen, p1.X, p1.Y, p2.X, p2.Y); }
public void DrawFilledRectangle(Rect theRect, ILineStyleInfo Line, IFillStyleInfo Fill) { TransformRect(theRect); SourceDrawOperations.DrawFilledRectangle(R, Line, Fill); }
public void DrawLine(Point p1, Point p2, ILineStyleInfo theStyle) { TransformPoint(p1, P1); TransformPoint(p2, P2); SourceDrawOperations.DrawLine(P1, P2, theStyle); }
private void InitStyles() { LightBorder = RendererSingleton.Instance.DrawOperations.Factory.ProduceNewLineStyleInfo(System.Drawing.Color.GhostWhite, 1); DarkBorder = RendererSingleton.Instance.DrawOperations.Factory.ProduceNewLineStyleInfo(System.Drawing.Color.Black, 1); Background = RendererSingleton.Instance.DrawOperations.Factory.ProduceNewFillStyleInfo(System.Drawing.Color.LightGray); }
public void DrawEllipse(Rect theRect, ILineStyleInfo theStyle) { mGraphics.DrawEllipse(((GDIPlusLineStyle)theStyle).Pen, theRect.GetRectangle()); }
public void FillPolygon(IList <Point> Points, ILineStyleInfo LineStyle, IFillStyleInfo FillStyle) { TransformPointList(Points); SourceDrawOperations.FillPolygon(Points, LineStyle, FillStyle); }