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 void FillRectangle(Rect theRect, IFillStyleInfo theStyle) { if (theStyle.FillColor == System.Drawing.Color.Transparent) { return; } switch (theStyle.Mode) { case GuiLabs.Canvas.DrawStyle.FillMode.Solid: FillRectangle( theRect, theStyle.FillColor); break; case GuiLabs.Canvas.DrawStyle.FillMode.HorizontalGradient: GradientFillRectangle( theRect, theStyle.FillColor, theStyle.GradientColor, LinearGradientMode.Horizontal); break; case GuiLabs.Canvas.DrawStyle.FillMode.VerticalGradient: GradientFillRectangle( theRect, theStyle.FillColor, theStyle.GradientColor, LinearGradientMode.Vertical); break; default: break; } }
public void FillRectangle(Rect theRect, IFillStyleInfo theStyle) { switch (theStyle.Mode) { case GuiLabs.Canvas.DrawStyle.FillMode.Solid: mGraphics.FillRectangle( ((GDIPlusFillStyle)theStyle).Brush, theRect.GetRectangle()); break; case GuiLabs.Canvas.DrawStyle.FillMode.HorizontalGradient: GradientFillRectangle( theRect, theStyle.FillColor, theStyle.GradientColor, LinearGradientMode.Horizontal); break; case GuiLabs.Canvas.DrawStyle.FillMode.VerticalGradient: GradientFillRectangle( theRect, theStyle.FillColor, theStyle.GradientColor, LinearGradientMode.Vertical); break; default: break; } }
public void AddStyle( string name, Color borderColor, IFillStyleInfo fill) { Add(name, new ShapeStyle(borderColor, fill)); }
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 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 FillRectangle(Rect theRect, IFillStyleInfo theStyle) { API.FillRectangle(hDC, theStyle.FillColor, 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) { 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 RectShape(IFillStyleInfo back) : this() { CurrentStyle.FillStyleInfo = back; }
public ShapeStyle(Color borderColor, IFillStyleInfo fill) { FillStyleInfo = fill; LineStyleInfo = RendererSingleton.Instance.DrawOperations.Factory.ProduceNewLineStyleInfo(borderColor, 1); FontStyleInfo = RendererSingleton.Instance.DrawOperations.Factory.ProduceNewFontStyleInfo(DefaultFont, DefaultFontSize, FontStyle.Regular); }
public void DrawFilledEllipse(Rect theRect, ILineStyleInfo Line, IFillStyleInfo Fill) { FillEllipse(theRect, Fill.FillColor); DrawEllipse(theRect, Line); }
public void FillRectangle(Rect theRect, IFillStyleInfo theStyle) { mGraphics.FillRectangle(((GDIPlusFillStyle)theStyle).Brush, theRect.GetRectangle()); }
public void FillRectangle(Rect theRect, IFillStyleInfo theStyle) { TransformRect(theRect); SourceDrawOperations.FillRectangle(R, theStyle); }
public void FillPolygon(IList <Point> Points, ILineStyleInfo LineStyle, IFillStyleInfo FillStyle) { TransformPointList(Points); SourceDrawOperations.FillPolygon(Points, LineStyle, FillStyle); }
public void FillPolygon(IList<Point> Points, ILineStyleInfo LineStyle, IFillStyleInfo FillStyle) { TransformPointList(Points); SourceDrawOperations.FillPolygon(Points, LineStyle, FillStyle); }
public CSharpStyleFactory() { #region Colors Color lightGray = Color.FromArgb(250, 250, 250); lightGray = Color.FromArgb(230, 230, 230); //lightGray = Color.FromArgb(255, 255, 230); Color niceGray = Color.FromArgb(246, 243, 243); Color classBack = lightGray; Color methodBack = lightGray; Color memberBack = Color.GhostWhite; Color namespaceBack = lightGray; Color propertyBack = lightGray; Color grayFrame = Color.Black; // Color.Gainsboro; Color deselectedFrame = Color.Transparent; //deselectedFrame = lightGray; //deselectedFrame = Color.Gainsboro; //Color controlStructure = Color.White; //Color controlStructure = Color.FromArgb(250, 250, 250); Color controlStructure = lightGray; Color typeName = Color.FromArgb(43, 145, 175); #endregion Color secondGradient = Color.White; Color namespaceGradient = Color.FromArgb(255, 220, 255); IFillStyleInfo namespaceBackground = RendererSingleton.StyleFactory.ProduceNewFillStyleInfo( namespaceGradient, secondGradient, FillMode.HorizontalGradient); IFillStyleInfo namespaceBackgroundSelected = RendererSingleton.StyleFactory.ProduceNewFillStyleInfo( namespaceGradient, secondGradient, FillMode.HorizontalGradient); Color typeGradient = Color.FromArgb(230, 230, 255); IFillStyleInfo typeBackground = RendererSingleton.StyleFactory.ProduceNewFillStyleInfo( typeGradient, secondGradient, FillMode.HorizontalGradient); IFillStyleInfo typeBackgroundSelected = RendererSingleton.StyleFactory.ProduceNewFillStyleInfo( typeGradient, secondGradient, FillMode.HorizontalGradient); Color memberGradient = Color.FromArgb(230, 255, 200); IFillStyleInfo memberBackground = RendererSingleton.StyleFactory.ProduceNewFillStyleInfo( memberGradient, secondGradient, FillMode.HorizontalGradient); IFillStyleInfo memberBackgroundSelected = RendererSingleton.StyleFactory.ProduceNewFillStyleInfo( memberGradient, secondGradient, FillMode.HorizontalGradient); Color fieldGradient = Color.FromArgb(230, 235, 255); IFillStyleInfo fieldBackground = RendererSingleton.StyleFactory.ProduceNewFillStyleInfo( fieldGradient, secondGradient, FillMode.HorizontalGradient); IFillStyleInfo fieldBackgroundSelected = RendererSingleton.StyleFactory.ProduceNewFillStyleInfo( fieldGradient, secondGradient, FillMode.HorizontalGradient); Color controlStructureGradient = Color.FromArgb(255, 240, 200); IFillStyleInfo controlStructureBackground = RendererSingleton.StyleFactory.ProduceNewFillStyleInfo( controlStructureGradient, secondGradient, FillMode.HorizontalGradient); IFillStyleInfo controlStructureBackgroundSelected = RendererSingleton.StyleFactory.ProduceNewFillStyleInfo( controlStructureGradient, secondGradient, FillMode.HorizontalGradient); AddStyle(StyleNames.Transparent, Color.Transparent, Color.Transparent); AddAlias(StyleNames.TransparentSel, StyleNames.Transparent); AddAliasAndSelected("Control", StyleNames.Transparent); #region Types AddStyle( StyleNames.TypeName, Color.Transparent, Color.Transparent, typeName //, "Consolas", 11, FontStyle.Regular ); AddAlias( StyleNames.TypeNameSel, StyleNames.TypeName); AddStyle("ClassBlock", deselectedFrame, typeBackground); AddStyle("ClassBlock_selected", grayFrame, typeBackgroundSelected); AddAliasAndSelected("StructBlock", "ClassBlock"); AddAliasAndSelected("InterfaceBlock", "ClassBlock"); AddAliasAndSelected("EnumBlock", "ClassBlock"); #endregion #region Namespace AddStyle("NamespaceBlock", deselectedFrame, namespaceBackground); AddStyle("NamespaceBlock_selected", grayFrame, namespaceBackgroundSelected); AddAliasAndSelected("UsingBlock", "NamespaceBlock"); #endregion #region Members AddStyle("MethodBlock", deselectedFrame, memberBackground); AddStyle("MethodBlock_selected", grayFrame, memberBackgroundSelected); AddStyle("FieldBlock", Color.Transparent, Color.Transparent); AddStyle("FieldBlock_selected", grayFrame, fieldBackgroundSelected); AddAliasAndSelected("PropertyBlock", "MethodBlock"); AddAliasAndSelected("PropertyAccessorBlock", "MethodBlock"); AddAliasAndSelected("InterfaceAccessorsBlock", "FieldBlock"); #endregion AddAliasAndSelected("DelegateBlock", "FieldBlock"); #region Method AddStyle("ControlStructureBlock", deselectedFrame, controlStructureBackground); AddStyle("ControlStructureBlock_selected", grayFrame, controlStructureBackgroundSelected); #endregion #region Text //ShapeStyle s = new ShapeStyle(); //s.Name = "GuiLabs.Editor.CSharp.ModifierLabelBlock_selected"; //s.FontStyleInfo = // GuiLabs.Canvas.Renderer.RendererSingleton.StyleFactory.ProduceNewFontStyleInfo( // "Lucida Console", // 14, // FontStyle.Regular); //s.LineColor = Color.BlueViolet; //Add(s); AddStyle("MemberNameBlock", Color.Transparent, Color.Transparent, Color.Black, FontStyle.Bold); AddStyle("MemberNameBlock_selected", Color.PaleGoldenrod, Color.LightYellow, Color.Black, FontStyle.Bold); AddStyle("CommentBlock", //Color.MintCream, //Color.MintCream, Color.Transparent, Color.Transparent, Color.Transparent, FillMode.HorizontalGradient); AddStyle("CommentBlock_selected", Color.Green, Color.MintCream, secondGradient, FillMode.HorizontalGradient); AddStyle("CommentLine", Color.Transparent, Color.Transparent, Color.Green, "Arial", 8, FontStyle.Regular); AddStyle("CommentLine_selected", Color.Transparent, Color.Transparent, Color.Green, "Arial", 8, FontStyle.Regular); AddStyle("ButtonBlock", Color.DarkRed, Color.Linen, Color.PeachPuff, FillMode.VerticalGradient); AddStyle("ButtonBlock_selected", Color.DarkRed, Color.Linen, Color.SandyBrown, FillMode.VerticalGradient); AddStyle("SpaceBlock", Color.Transparent, Color.Transparent); AddStyle("SpaceBlock_selected", Color.DarkBlue, Color.LightCyan); AddStyle("StatementLine", Color.Transparent, Color.Transparent); AddStyle("StatementLine_selected", Color.LightGray, Color.LightYellow); AddStyle("KeywordLabel", Color.Transparent, Color.Transparent, Color.Blue); AddStyle("KeywordLabel_selected", Color.Blue, Color.LightCyan, Color.Blue); AddStyle("AttributeBlock", Color.Yellow, Color.LightYellow); AddStyle("AttributeBlock_selected", Color.DarkKhaki, Color.Yellow); AddStyle("OneWordStatement", Color.Transparent, Color.Transparent, Color.Blue); AddStyle("OneWordStatement_selected", Color.Gray, Color.Yellow, Color.Black); AddStyle("TextBox", Color.Transparent, Color.Transparent); AddStyle("TextBox_selected", Color.Transparent, Color.Transparent); AddAliasAndSelected("Label", "TextBox"); AddAliasAndSelected("TextLine", "TextBox"); AddAliasAndSelected("ExpressionBlock", "TextLine"); #endregion #region Modifiers AddAliasAndSelected("ModifierSelectionBlock", "KeywordLabel"); AddAliasAndSelected("ModifierSeparatorBlock", "KeywordLabel"); AddStyle("TypeSelection", Color.Transparent, Color.Transparent, typeName); AddStyle("TypeSelection_selected", Color.Blue, Color.LightCyan, typeName); AddAliasAndSelected("InterfacePropertyAccessor", "ModifierSelectionBlock"); #endregion }
public void DrawFilledEllipse(Rect theRect, ILineStyleInfo Line, IFillStyleInfo Fill) { TransformRect(theRect); SourceDrawOperations.DrawFilledEllipse(R, Line, Fill); }
public void DrawFilledRectangle(Rect theRect, ILineStyleInfo Line, IFillStyleInfo Fill) { TransformRect(theRect); SourceDrawOperations.DrawFilledRectangle(R, Line, Fill); }