|
| 1 | +/* |
| 2 | +* MIT License |
| 3 | +* |
| 4 | +* Copyright (c) 2017-2021 Jingwood, unvell.com. All right reserved. |
| 5 | +* |
| 6 | +* Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | +* of this software and associated documentation files (the "Software"), to deal |
| 8 | +* in the Software without restriction, including without limitation the rights |
| 9 | +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | +* copies of the Software, and to permit persons to whom the Software is |
| 11 | +* furnished to do so, subject to the following conditions: |
| 12 | +* |
| 13 | +* The above copyright notice and this permission notice shall be included in all |
| 14 | +* copies or substantial portions of the Software. |
| 15 | +* |
| 16 | +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | +* SOFTWARE. |
| 23 | +*/ |
| 24 | + |
| 25 | +using System; |
| 26 | +using System.Collections.Generic; |
| 27 | +using System.Drawing; |
| 28 | +using System.Windows.Forms; |
| 29 | +using unvell.D2DLib.WinForm; |
| 30 | + |
| 31 | +namespace unvell.D2DLib.Examples.SampleCode |
| 32 | +{ |
| 33 | + public partial class LineCapStyle : ExampleForm |
| 34 | + { |
| 35 | + public LineCapStyle() |
| 36 | + { |
| 37 | + Text = "LineCapStyle Tests - d2dlib Examples"; |
| 38 | + } |
| 39 | + |
| 40 | + protected override void OnRender(D2DGraphics g) |
| 41 | + { |
| 42 | + g.DrawText("Flat", D2DColor.DimGray, "Arials", 20, 110, 83); |
| 43 | + g.DrawLine(300, 100, 600, 100, D2DColor.Black, 20, D2DDashStyle.Solid, D2DCapStyle.Flat, D2DCapStyle.Flat); |
| 44 | + |
| 45 | + g.DrawText("Round", D2DColor.DimGray, "Arials", 20, 110, 183); |
| 46 | + g.DrawLine(300, 200, 600, 200, D2DColor.Black, 20, D2DDashStyle.Solid, D2DCapStyle.Round, D2DCapStyle.Round); |
| 47 | + |
| 48 | + g.DrawText("Square", D2DColor.DimGray, "Arials", 20, 110, 283); |
| 49 | + g.DrawLine(300, 300, 600, 300, D2DColor.Black, 20, D2DDashStyle.Solid, D2DCapStyle.Square, D2DCapStyle.Square); |
| 50 | + |
| 51 | + g.DrawText("Triangle", D2DColor.DimGray, "Arials", 20, 110, 383); |
| 52 | + g.DrawLine(300, 400, 600, 400, D2DColor.Black, 20, D2DDashStyle.Solid, D2DCapStyle.Triangle, D2DCapStyle.Triangle); |
| 53 | + |
| 54 | + g.DrawText("Round, Triangle", D2DColor.DimGray, "Arials", 20, 110, 483); |
| 55 | + g.DrawLine(300, 500, 600, 500, D2DColor.Black, 20, D2DDashStyle.Solid, D2DCapStyle.Round, D2DCapStyle.Triangle); |
| 56 | + } |
| 57 | + } |
| 58 | + |
| 59 | +} |
0 commit comments