Пример #1
0
        public CairoStroke(XmlTextReader xml) : this()
        {
            minX = Convert.ToDouble(xml.GetAttribute("left"));
            minY = Convert.ToDouble(xml.GetAttribute("top"));
            maxX = Convert.ToDouble(xml.GetAttribute("right"));
            maxY = Convert.ToDouble(xml.GetAttribute("bottom"));

            style         = new PenStyle();
            style.PenSize = Convert.ToDouble(xml.GetAttribute("size"));

            int depth = xml.Depth;

            while (xml.Read() && xml.Depth > depth)
            {
                if (xml.NodeType == XmlNodeType.Element)
                {
                    if (xml.Name == "point")
                    {
                        x.Add(Convert.ToDouble(xml.GetAttribute("x")));
                        y.Add(Convert.ToDouble(xml.GetAttribute("y")));
                        color.Add(new Cairo.Color(
                                      Convert.ToDouble(xml.GetAttribute("r")),
                                      Convert.ToDouble(xml.GetAttribute("g")),
                                      Convert.ToDouble(xml.GetAttribute("b")),
                                      Convert.ToDouble(xml.GetAttribute("a"))));
                        count++;
                    }
                    else
                    {
                        Console.WriteLine("Ignoring Unknown XML Element: {0}",
                                          xml.Name);
                    }
                }
            }
        }
Пример #2
0
        public GDIPen(PenType aType, PenStyle aStyle, PenJoinStyle aJoinStyle, PenEndCap aEndCap, Colorref colorref, int width, Guid uniqueID)
            : base(true,uniqueID)
        {
            TypeOfPen = aType;
            Style = aStyle;
            JoinStyle = aJoinStyle;
            EndCap = aEndCap;
            Width = width;
            Color = colorref;


            int combinedStyle = (int)aStyle | (int)aType | (int)aJoinStyle | (int)aEndCap;
            fLogBrush = new LOGBRUSH();
            fLogBrush.lbColor = colorref;
            fLogBrush.lbHatch = IntPtr.Zero;
            fLogBrush.lbStyle = (int)BrushStyle.Solid;

            if (PenType.Cosmetic == aType)
            {
                // If it's cosmetic, the width must be 1
                width = 1;

                // The color must be in the brush structure
                // Must mask off the alpha, or we'll get black
                fLogBrush.lbColor = colorref & 0x00ffffff;

                // The brush style must be solid
                fLogBrush.lbStyle = (int)BrushStyle.Solid;
            }


            IntPtr penHandle = GDI32.ExtCreatePen((uint)combinedStyle, (uint)width, ref fLogBrush, 0, IntPtr.Zero);

            SetHandle(penHandle);
        }
Пример #3
0
 //Handles choosing different line types from Line types combo box
 private void LineTypesComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (LineTypesComboBox.SelectedIndex != -1)
     {
         penStyle = (PenStyle)LineTypesComboBox.SelectedItem;
     }
 }
Пример #4
0
        internal static IntPtr CreatePen(PowerLanguage.PenStyle pen)
        {
            PenStyle cStyle = PenStyle.PS_NULL;

            uint uMask = (uint)pen.Pattern;

            switch (uMask)
            {
            case 0xeeeeeeee:
                cStyle = PenStyle.PS_DASH;
                break;

            case 0xebaebaeb:
                cStyle = PenStyle.PS_DASHDOT;
                break;

            case 0xeaeaeaea:
                cStyle = PenStyle.PS_DASHDOTDOT;
                break;

            case 0xaaaaaaaa:
                cStyle = PenStyle.PS_DOT;
                break;

            default:
                cStyle = PenStyle.PS_SOLID;
                break;
            }
            return(CreatePen(cStyle, (int)pen.Width, (uint)ColorTranslator.ToWin32(pen.Color)));
        }
Пример #5
0
 public Pen(Color color, Measurement width = default(Measurement), PenStyle style = PenStyle.Solid)
 {
     mvarStyle = style;
     if (width.Equals(default(Measurement))) width = new Measurement(1.0, MeasurementUnit.Pixel);
     mvarWidth = width;
     mvarColor = color;
 }
Пример #6
0
        public void ReadXml(XmlReader reader)
        {
            reader.MoveToContent();

            Color    = Color.FromString(reader.GetAttribute("Color"));
            PenStyle = (PenStyle)Enum.Parse(typeof(PenStyle), reader.GetAttribute("PenStyle"));
        }
Пример #7
0
        public CairoStroke(XmlTextReader xml) : this()
        {
            minX = Convert.ToDouble(xml.GetAttribute("left"));
            minY = Convert.ToDouble(xml.GetAttribute("top"));
            maxX = Convert.ToDouble(xml.GetAttribute("right"));
            maxY = Convert.ToDouble(xml.GetAttribute("bottom"));

            style = new PenStyle();
            style.PenSize = Convert.ToDouble(xml.GetAttribute("size"));

            int depth = xml.Depth;
            while(xml.Read() && xml.Depth > depth) {
                if(xml.NodeType == XmlNodeType.Element) {
                    if(xml.Name == "point") {
                        x.Add(Convert.ToDouble(xml.GetAttribute("x")));
                        y.Add(Convert.ToDouble(xml.GetAttribute("y")));
                        color.Add(new Cairo.Color(
                            Convert.ToDouble(xml.GetAttribute("r")),
                            Convert.ToDouble(xml.GetAttribute("g")),
                            Convert.ToDouble(xml.GetAttribute("b")),
                            Convert.ToDouble(xml.GetAttribute("a"))));
                        count++;
                     } else {
                         Console.WriteLine("Ignoring Unknown XML Element: {0}",
                             xml.Name);
                     }
                }
            }
        }
Пример #8
0
        public static DoubleCollection MapsuiPentoXaml(PenStyle penStyle)
        {
            switch (penStyle)
            {
                case PenStyle.Dash:
                    return new DoubleCollection {2, 2};
                case PenStyle.DashDot:
                    return new DoubleCollection {2, 2, 1, 2};
                case PenStyle.DashDotDot:
                    return new DoubleCollection {2, 2, 1, 2, 1, 2};
                case PenStyle.Dot:
                    return new DoubleCollection {1, 2};
                case PenStyle.LongDash:
                    return new DoubleCollection {2, 3};
                case PenStyle.LongDashDot:
                    return new DoubleCollection {2, 3, 1, 3};
                case PenStyle.ShortDash:
                    return new DoubleCollection {2, 1};
                case PenStyle.ShortDashDot:
                    return new DoubleCollection {2, 1, 1, 1};
                case PenStyle.ShortDashDotDot:
                    return new DoubleCollection {2, 1, 1, 1, 1, 1};
                case PenStyle.ShortDot:
                    return new DoubleCollection {1, 1};
            }

            return null;
        }
Пример #9
0
 /// <summary>
 /// 初始化对象
 /// </summary>
 /// <param name="style">画笔类型</param>
 /// <param name="width">线宽</param>
 /// <param name="color">颜色</param>
 public GDIPen(PenStyle style, int width, System.Drawing.Color color)
 {
     intStyle       = style;
     this.intWidth  = width;
     this.intColor  = color;
     this.intHandle = CreatePen(( int )intStyle, intWidth, ColorToInt(color));
 }
Пример #10
0
 private static Pen CreatePen(Color color, int width, PenStyle penStyle)
 {
     return(new Pen(color, width)
     {
         PenStyle = penStyle
     });
 }
Пример #11
0
        public static SKPathEffect ToSkia(this PenStyle penStyle, float width)
        {
            switch (penStyle)
            {
            case PenStyle.Dash:
                return(SKPathEffect.CreateDash(new float[2] {
                    width * 4f, width * 3f
                }, 0));

            case PenStyle.Dot:
                return(SKPathEffect.CreateDash(new float[2] {
                    width * 1f, width * 3f
                }, 0));

            case PenStyle.DashDot:
                return(SKPathEffect.CreateDash(new float[4] {
                    width * 4f, width * 3f, width * 1f, width * 3f
                }, 0));

            case PenStyle.DashDotDot:
                return(SKPathEffect.CreateDash(new float[6] {
                    width * 4f, width * 3f, width * 1f, width * 3f, width * 1f, width * 3f
                }, 0));

            case PenStyle.LongDash:
                return(SKPathEffect.CreateDash(new float[2] {
                    width * 8f, width * 3f
                }, 0));

            case PenStyle.LongDashDot:
                return(SKPathEffect.CreateDash(new float[4] {
                    width * 8f, width * 3f, width * 1f, width * 3f
                }, 0));

            case PenStyle.ShortDash:
                return(SKPathEffect.CreateDash(new float[2] {
                    width * 2f, width * 3f
                }, 0));

            case PenStyle.ShortDashDot:
                return(SKPathEffect.CreateDash(new float[4] {
                    width * 2f, width * 3f, width * 1f, width * 3f
                }, 0));

            case PenStyle.ShortDashDotDot:
                return(SKPathEffect.CreateDash(new float[6] {
                    width * 2f, width * 3f, width * 1f, width * 3f, width * 1f, width * 3f
                }, 0));

            case PenStyle.ShortDot:
                return(SKPathEffect.CreateDash(new float[2] {
                    width * 1f, width * 3f
                }, 0));

            default:
                return(SKPathEffect.CreateDash(new float[0], 0));
            }
        }
Пример #12
0
        public static DoubleCollection MapsuiPentoXaml(PenStyle penStyle)
        {
            switch (penStyle)
            {
            case PenStyle.Dash:
                return(new DoubleCollection {
                    2, 2
                });

            case PenStyle.DashDot:
                return(new DoubleCollection {
                    2, 2, 1, 2
                });

            case PenStyle.DashDotDot:
                return(new DoubleCollection {
                    2, 2, 1, 2, 1, 2
                });

            case PenStyle.Dot:
                return(new DoubleCollection {
                    1, 2
                });

            case PenStyle.LongDash:
                return(new DoubleCollection {
                    2, 3
                });

            case PenStyle.LongDashDot:
                return(new DoubleCollection {
                    2, 3, 1, 3
                });

            case PenStyle.ShortDash:
                return(new DoubleCollection {
                    2, 1
                });

            case PenStyle.ShortDashDot:
                return(new DoubleCollection {
                    2, 1, 1, 1
                });

            case PenStyle.ShortDashDotDot:
                return(new DoubleCollection {
                    2, 1, 1, 1, 1, 1
                });

            case PenStyle.ShortDot:
                return(new DoubleCollection {
                    1, 1
                });
            }

            return(null);
        }
Пример #13
0
 public Pen(Color color, Measurement width = default(Measurement), PenStyle style = PenStyle.Solid)
 {
     mvarStyle = style;
     if (width.Equals(default(Measurement)))
     {
         width = new Measurement(1.0, MeasurementUnit.Pixel);
     }
     mvarWidth = width;
     mvarColor = color;
 }
        public override void CreateCosmeticPen(PenStyle aStyle, uint color, Guid uniqueID)
        {
            BufferChunk chunk = new BufferChunk(1024);

            chunk += GDI32.EMR_CREATECOSMETICPEN;
            chunk += (int)aStyle;
            chunk += (int)1;    // Width
            chunk += color;
            Pack(chunk, uniqueID);

            PackCommand(chunk);
        }
Пример #15
0
        public WmfCreatePenIndirectRecord AddCreatePenIndirect(Color color, PenStyle style = PenStyle.PS_SOLID, int size = 1)
        {
            var record = new WmfCreatePenIndirectRecord()
            {
                Color = color,
                Style = style,
                Width = new Point(size, size)
            };

            this.Records.Add(record);
            return(record);
        }
Пример #16
0
        public static SKPathEffect ToSkia(this PenStyle penStyle, float width, float[] dashArray = null, float dashOffset = 0)
        {
            switch (penStyle)
            {
            case PenStyle.UserDefined:
                // If dashArray is empty or not even, create sold dash
                if (dashArray == null || dashArray.Length == 0 || dashArray.Length % 2 != 0)
                {
                    return(SKPathEffect.CreateDash(new float[0], 0));
                }
                // Multiply each dash entry with line width
                float[] dash = new float[dashArray.Length];
                for (var i = 0; i < dashArray.Length; i++)
                {
                    dash[i] = dashArray[i] * width;
                }
                return(SKPathEffect.CreateDash(dash, dashOffset));

            case PenStyle.Dash:
                return(SKPathEffect.CreateDash(new [] { width * 4f, width * 3f }, dashOffset));

            case PenStyle.Dot:
                return(SKPathEffect.CreateDash(new [] { width * 1f, width * 3f }, dashOffset));

            case PenStyle.DashDot:
                return(SKPathEffect.CreateDash(new [] { width * 4f, width * 3f, width * 1f, width * 3f }, dashOffset));

            case PenStyle.DashDotDot:
                return(SKPathEffect.CreateDash(new [] { width * 4f, width * 3f, width * 1f, width * 3f, width * 1f, width * 3f }, dashOffset));

            case PenStyle.LongDash:
                return(SKPathEffect.CreateDash(new [] { width * 8f, width * 3f }, dashOffset));

            case PenStyle.LongDashDot:
                return(SKPathEffect.CreateDash(new [] { width * 8f, width * 3f, width * 1f, width * 3f }, dashOffset));

            case PenStyle.ShortDash:
                return(SKPathEffect.CreateDash(new [] { width * 2f, width * 3f }, dashOffset));

            case PenStyle.ShortDashDot:
                return(SKPathEffect.CreateDash(new [] { width * 2f, width * 3f, width * 1f, width * 3f }, dashOffset));

            case PenStyle.ShortDashDotDot:
                return(SKPathEffect.CreateDash(new [] { width * 2f, width * 3f, width * 1f, width * 3f, width * 1f, width * 3f }, dashOffset));

            case PenStyle.ShortDot:
                return(SKPathEffect.CreateDash(new [] { width * 1f, width * 3f }, dashOffset));

            default:
                return(SKPathEffect.CreateDash(new float[0], dashOffset));
            }
        }
Пример #17
0
        public PDFPen(Color color, double thickness, PenStyle style = PenStyle.Solid)
        {
            Color     = color;
            Thickness = thickness;
            Style     = style;

            pdfColor = new PDFColor(Color);

            //and somehow this have to translate into  0 0 0 RG [] 0 d 1 w thickness
            // color  = 0 0 0 RG color.R + color.G + color.B + RG
            // style either normal or dashed for now = [] or [3] the number inside the parenthesis represent the length of each each dash
            //thickness will replace number infront of w
        }
Пример #18
0
        public static void Apply([NotNull] this Editor source, PenStyle style)
        {
            Debug.WriteLine($"{nameof(Editor)}.{nameof(Apply)}:");
            if (!(source.Renderer is { } renderer))
            {
                return;
            }

            source.PenStyle =
                $"{StyleKeys.Color}: {style.Color.ToNative().ToHex()}; " +
                $"{StyleKeys.MyScriptPenBrush}: {style.Brush}; " +
                $"{StyleKeys.MyScriptPenWidth}: {style.Size.Width.FromPixelToMillimeter(renderer.DpiX)}";
            Debug.WriteLine($"\t{nameof(source.PenStyle)}: {source.PenStyle}");
        }
Пример #19
0
        //Form constructor
        public MainForm()
        {
            //Load the app language from xml
            XmlDocument XmlDocument = new XmlDocument();

            try
            {
                XmlDocument.Load("config.xml");
                XmlElement element = XmlDocument.DocumentElement;
                XmlNode    node    = element["Language"];

                Language = (node["CurrL"].InnerText);

                XmlDocument.Save("config.xml");
                Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(Language);
            }
            catch
            {
                Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
                Language = "en-US";
            }

            InitializeComponent();
            //Instantiate shape object makers
            MCircle    = new CircleMaker();
            MLine      = new LineMaker();
            MOval      = new OvalMaker();
            MRectangle = new RectangleMaker();
            MSquare    = new SquareMaker();
            MTriangle  = new TriangleMaker();
            //Instantiate a list of drawn shapes
            DrawnShapesList = new ShapeList();
            //Initialize default options
            SelectedMaker     = MLine;
            SelectedShapeName = MLine.EngName;
            CurrentShape.Text = StatusBarMessage + SelectedShapeName;
            penStyle          = new PenStyle("Solid", "Сплошная", System.Drawing.Drawing2D.DashStyle.Solid);
            //Instantiate pen style list
            penStyleList = new List <PenStyle>();

            //Adding penStyles to a list which'll be made to a data source for the combo box
            penStyleList.Add(penStyle);
            penStyleList.Add(new PenStyle("Dash", "Пунктир", System.Drawing.Drawing2D.DashStyle.Dash));
            penStyleList.Add(new PenStyle("Dash-dot", "Штрих-пунктир", System.Drawing.Drawing2D.DashStyle.DashDot));
            penStyleList.Add(new PenStyle("Dash-dot-dot", "Штрих-пунктир-пунктир", System.Drawing.Drawing2D.DashStyle.DashDotDot));
            penStyleList.Add(new PenStyle("Dot", "Пунктир", System.Drawing.Drawing2D.DashStyle.Dot));
            LineTypesComboBox.DataSource    = penStyleList;
            LineTypesComboBox.DisplayMember = "EngName";
        }
Пример #20
0
        public override JObject SaveToJsonObject(StiJsonSaveMode mode)
        {
            var jObject = base.SaveToJsonObject(mode);

            if (Brush != null)
            {
                jObject.Add(new JProperty("Brush", SaveBrushToJsonObject(Brush, mode)));
            }
            jObject.Add(new JProperty("Thickness", Thickness));
            jObject.Add(new JProperty("PenStyle", PenStyle.ToString()));
            jObject.Add(new JProperty("Alignment", Alignment.ToString()));
            jObject.Add(new JProperty("StartCap", StartCap.ToString()));
            jObject.Add(new JProperty("EndCap", EndCap.ToString()));

            return(jObject);
        }
Пример #21
0
        public GPen(PenType aType, PenStyle aStyle, PenJoinStyle aJoinStyle, PenEndCap aEndCap, Colorref colorref, int width, Guid uniqueID)
        {
            TypeOfPen = aType;
            Style = aStyle;
            JoinStyle = aJoinStyle;
            EndCap = aEndCap;
            Width = width;
            Color = colorref;

            this.UniqueID = uniqueID;

            //int combinedStyle = (int)aStyle | (int)aType | (int)aJoinStyle | (int)aEndCap;

            if (PenType.Cosmetic == aType)
            {
                // If it's cosmetic, the width must be 1
                width = 1;
            }
        }
Пример #22
0
        public Handwriting() : base()
        {
            strokes      = new List <CairoStroke>();
            undo         = 0;
            AppPaintable = true;
            Events       = EventMask.ExposureMask | EventMask.ButtonPressMask |
                           EventMask.ButtonReleaseMask | EventMask.PointerMotionMask;
            ExtensionEvents = ExtensionMode.Cursor;

            paper = new NotebookPaper(White);

            penStyle          = new PenStyle();
            penStyle.PenColor = new Cairo.Color(0.0, 0.0, 1.0, 1.0);
            penStyle.PenSize  = 3.0;

            eraserStyle          = new PenStyle();
            eraserStyle.PenColor = paperColor;
            eraserStyle.PenSize  = 10.0;

//            GdkWindow.Cursor = Cursor.NewFromName(Display.Default, "Clock");
        }
Пример #23
0
        // There is a bug in the generic intel graphics driver which causes an intermittent
        // access violation, replaced the GDI+ calls with GDI32 calls. 

        // 6.14.10.4957 - Works
        // According to Lenovo ; Intel significantly updated their GDI handling code based on the 
        // internal release notes they have and they are not available in the public domain.

        // The following versions are affected :

        // 6.14.10.5082 - Dell OptiPlex
        // 6.14.10.5068 - Lenovo Laptop


        public static void DrawLine(Graphics graphics, Point start, Point end, Color colour, PenStyle penStyle)
        {
            IntPtr hdc = graphics.GetHdc();
            try
            {
                IntPtr pen = CreatePen(penStyle, 1, (uint)ColorTranslator.ToWin32(colour));
                IntPtr oldpen = SelectObject(hdc, pen);
                try
                {
                    MoveToEx(hdc, start.X, start.Y, IntPtr.Zero);
                    LineTo(hdc, end.X, end.Y);
                }
                finally
                {
                    DeleteObject(SelectObject(hdc, oldpen));
                }
            }
            finally
            {
                graphics.ReleaseHdc();
            }
        }
Пример #24
0
 public static extern IntPtr CreatePen(PenStyle nPenStyle, int nWidth, int crColor);
Пример #25
0
 public Square(Color color, int thickness, PenStyle penStyle, int x1, int y1, int x2, int y2) : base(color, thickness, penStyle, x1, y1, x2, y2)
 {
     engname = "Square";
     rusname = "Квадрат";
 }
Пример #26
0
 public virtual void CreatePen(PenType aType, PenStyle aStyle, PenJoinStyle aJoinStyle, PenEndCap aEndCap, uint colorref, int width, Guid uniqueID)
 {
     GDIPen aPen = DeviceContext.CreatePen(aType, aStyle, aJoinStyle, aEndCap, colorref, width, uniqueID);
     fObjectDictionary.Add(uniqueID, aPen);
 }
Пример #27
0
 public NativePen(PenStyle fnPenStyle, int nWidth, COLORREF crColor) : this()
 {
     _hpen = NativeMethods.CreatePen(fnPenStyle, nWidth, crColor.Value);
 }
Пример #28
0
    public override void CreateCosmeticPen(PenStyle aStyle, uint color, Guid uniqueID)
    {
        BufferChunk chunk = new BufferChunk(1024);
        chunk += GDI32.EMR_CREATECOSMETICPEN;
        chunk += (int)aStyle;
        chunk += (int)1;    // Width
        chunk += color;
        Pack(chunk, uniqueID);

        PackCommand(chunk);
    }
 private static extern IntPtr CreatePen(PenStyle fnPenStyle, int nWidth, uint crColor);
Пример #30
0
 public CairoStroke(PenStyle penStyle) : this()
 {
     style = penStyle;
 }
Пример #31
0
 public Circle(Color color, int thickness, PenStyle penStyle, int x1, int y1, int x2, int y2) : base(color, thickness, penStyle, x1, y1, x2, y2)
 {
     engname = "Circle";
     rusname = "Круг";
 }
Пример #32
0
 public Rectangle(Color color, int thickness, PenStyle penStyle, int x1, int y1, int x2, int y2) : base(color, thickness, penStyle, x1, y1, x2, y2)
 {
     engname = "Rectangle";
     rusname = "Прямоугольник";
 }
Пример #33
0
 public virtual void CreateCosmeticPen(PenStyle aStyle, uint color, Guid uniqueID)
 {
     GDICosmeticPen aPen = new GDICosmeticPen(aStyle, color, uniqueID);
     fObjectDictionary.Add(uniqueID, aPen);
 }
Пример #34
0
 public static extern IntPtr CreatePen(PenStyle fnPenStyle, int nWidth, COLORREF crColor);
Пример #35
0
		[DllImport("gdi32.dll")] public static extern IntPtr CreatePen( PenStyle fnPenStyle, int nWidth, uint crColor );
Пример #36
0
 static extern IntPtr CreatePen(PenStyle fnPenStyle, int nWidth, uint crColor);
Пример #37
0
 public GDICosmeticPen(PenStyle penStyle, Colorref colorref, Guid uniqueID)
     : base(PenType.Cosmetic, penStyle, PenJoinStyle.Round, PenEndCap.Round, colorref, 1, uniqueID)
 {
 }
Пример #38
0
        public Handwriting() : base()
        {
            strokes = new List<CairoStroke>();
            undo = 0;
            AppPaintable = true;
            Events = EventMask.ExposureMask | EventMask.ButtonPressMask |
                     EventMask.ButtonReleaseMask | EventMask.PointerMotionMask;
            ExtensionEvents = ExtensionMode.Cursor;

            paper = new NotebookPaper(White);

            penStyle = new PenStyle();
            penStyle.PenColor = new Cairo.Color(0.0,0.0,1.0,1.0);
            penStyle.PenSize  = 3.0;

            eraserStyle = new PenStyle();
            eraserStyle.PenColor = paperColor;
            eraserStyle.PenSize  = 10.0;

//            GdkWindow.Cursor = Cursor.NewFromName(Display.Default, "Clock");
        }
Пример #39
0
 public static extern IntPtr CreatePen(PenStyle Style, int Width, uint Color);
 private System.Drawing.Drawing2D.DashStyle PenStyleToDashStyle(PenStyle penStyle)
 {
     switch (penStyle)
     {
         case PenStyle.Custom: return System.Drawing.Drawing2D.DashStyle.Custom;
         case PenStyle.Dash: return System.Drawing.Drawing2D.DashStyle.Dash;
         case PenStyle.DashDot: return System.Drawing.Drawing2D.DashStyle.DashDot;
         case PenStyle.DashDotDot: return System.Drawing.Drawing2D.DashStyle.DashDotDot;
         case PenStyle.Dot: return System.Drawing.Drawing2D.DashStyle.Dot;
         case PenStyle.Solid: return System.Drawing.Drawing2D.DashStyle.Solid;
     }
     return System.Drawing.Drawing2D.DashStyle.Solid;
 }
Пример #41
0
 public SelectedSeriesStyle(PenStyle selectedStrokeStyle, IPointMarker selectedPointMarker)
 {
     _selectedStrokeStyle = selectedStrokeStyle;
     _selectedPointMarker = selectedPointMarker;
 }
Пример #42
0
		internal extern static IntPtr Win32CreatePen(PenStyle fnPenStyle, int nWidth, ref COLORREF color);
Пример #43
0
 internal static extern IntPtr CreatePen(PenStyle penStyle, int width, uint color);
Пример #44
0
 public virtual GDIPen CreatePen(PenType aType, PenStyle aStyle, PenJoinStyle aJoinStyle, PenEndCap aEndCap, Colorref colorref, int width, Guid uniqueID)
 {
     GDIPen aPen = new GDIPen(aType, aStyle, aJoinStyle, aEndCap, colorref, width, uniqueID);
     return aPen;
 }
Пример #45
0
		internal extern static IntPtr Win32CreatePen(PenStyle fnPenStyle, int nWidth, IntPtr color);
Пример #46
0
 internal static extern IntPtr ExtCreatePen(PenStyle dwPenStyle, uint dwWidth,
                                            [In] ref LOGBRUSH lplb, uint dwStyleCount, uint[] lpStyle);
Пример #47
0
 public override Shape Make(Color color, int thickness, PenStyle penStyle, int x1, int y1, int x2, int y2)
 {
     return(new Rectangle(color, thickness, penStyle, x1, y1, x2, y2));
 }
Пример #48
0
        private void GetChartSetting()
        {
            PenStyle[] cPenStyles  = new PenStyle[2];
            int        iChartIndex = listChartType.SelectedIndex;

            switch (iChartIndex)
            {
            case 0:                      //美國線
                __cChartSetting.ChartType = EChartType.OHLC;
                break;

            case 1:                      //HLC線
                __cChartSetting.ChartType = EChartType.HLC;
                break;

            case 2:                      //蠟燭線
                __cChartSetting.ChartType = EChartType.Candlestick;
                cPenStyles = new PenStyle[3];
                break;

            case 3:                      //收盤線
                __cChartSetting.ChartType = EChartType.ClosingLine;
                break;
            }

            cPenStyles[0] = new PenStyle(colorUp.SelectedColor, comboUpWidth.SelectedIndex + 1);
            cPenStyles[1] = new PenStyle(colorDown.SelectedColor, comboDownWidth.SelectedIndex + 1);
            if (iChartIndex == 2)
            {
                cPenStyles[2] = new PenStyle(colorLine.SelectedColor, comboLineWidth.SelectedIndex + 1);
            }
            __cChartSetting.PenStyles   = cPenStyles;
            __cChartSetting.LegendColor = colorLegend.SelectedColor;

            bool bSubChart = listSubChart.SelectedIndex == 0;

            __cChartSetting.IsSubChart     = bSubChart;
            __cChartSetting.LayerIndex     = comboLayer.SelectedIndex;
            __cChartSetting.IsShowNewPrice = checkShowNewPrice.Checked;

            //座標資訊設定
            AxisSetting cAxisSetting = (__cChartSetting.Axis == null) ? new AxisSetting() : __cChartSetting.Axis;
            int         iAxisIndex   = listAxisRange.SelectedIndex;

            switch (iAxisIndex)
            {
            case 0:                      //目前區間
                cAxisSetting.AxisScope = EAxisScope.CurrentScope;
                break;

            case 1:                      //全部數列
                cAxisSetting.AxisScope = EAxisScope.AllScope;
                break;

            case 2:                      //變動大小
                cAxisSetting.AxisScope = EAxisScope.ChangeScope;
                break;

            case 3:                      //價格區間
                cAxisSetting.AxisScope = EAxisScope.PriceScaleScope;
                break;
            }

            if (checkMargin.Checked)
            {
                double dValue = 0;
                if (double.TryParse(txtTopMargin.Text, out dValue))
                {
                    cAxisSetting.MarginTop = dValue;
                }

                if (double.TryParse(txtBottomMargin.Text, out dValue))
                {
                    cAxisSetting.MarginBottom = dValue;
                }
            }

            if (checkManualAxis.Checked)
            {
                double dValue = 0;
                if (radioScaleGap.Checked)
                {
                    if (double.TryParse(txtScaleGap.Text, out dValue))
                    {
                        cAxisSetting.ScaleMode = EAxisScaleMode.ScaleGap;
                    }
                }
                else if (radioScaleCount.Checked)
                {
                    if (double.TryParse(txtScaleCount.Text, out dValue))
                    {
                        cAxisSetting.ScaleMode = EAxisScaleMode.ScaleCount;
                    }
                }
                else
                {
                    cAxisSetting.ScaleMode = EAxisScaleMode.None;
                }
                cAxisSetting.ScaleValue = dValue;
            }
            else
            {
                cAxisSetting.ScaleMode = EAxisScaleMode.None;
            }
            __cChartSetting.Axis = cAxisSetting;
        }
Пример #49
0
 public static Media.DoubleCollection ToXaml(this PenStyle penStyle)
 {
     return(StyleConverter.MapsuiPentoXaml(penStyle));
 }
 public StraightTriangle(Color color, int thickness, PenStyle penStyle, int x1, int y1, int x2, int y2) : base(color, thickness, penStyle, x1, y1, x2, y2)
 {
     engname = "Straight triangle";
     rusname = "Прямоульный треугольник";
 }