本文整理汇总了C#中LineCap类的典型用法代码示例。如果您正苦于以下问题:C# LineCap类的具体用法?C# LineCap怎么用?C# LineCap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LineCap类属于命名空间,在下文中一共展示了LineCap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configure
private void Configure()
{
_joinType = LineJoinType.Round;
_startCap = LineCap.Round;
_endCap = LineCap.Round;
_decorations = new CopyList<ILineDecoration>();
}
示例2: SetLineCap
// Set/get line caps: start, end, and dash
// Line cap and join APIs by using LineCap and LineJoin enums.
public GpStatus SetLineCap(LineCap startCap,
LineCap endCap,
DashCap dashCap)
{
return SetStatus(NativeMethods.GdipSetPenLineCap197819(nativePen,
startCap, endCap, dashCap));
}
示例3: PenDialog
public PenDialog(int p, LineCap lineCap)
{
InitializeComponent();
penSizeNumericUpDown.Value = p;
//switch (lineCap)
//{
// case LineCap.AnchorMask:
// {
// penStyleNumericUpDown.Value = 1;
// }
// break;
// case LineCap.ArrowAnchor:
// {
// penStyleNumericUpDown.Value = 2;
// }
// break;
// case LineCap.Custom:
// {
// penStyleNumericUpDown.Value = 3;
// }
// break;
// case LineCap.DiamondAnchor:
// {
// penStyleNumericUpDown.Value = 4;
// }
// break;
// case LineCap.Flat:
// {
// penStyleNumericUpDown.Value = 5;
// }
// break;
// case LineCap.NoAnchor:
// {
// penStyleNumericUpDown.Value = 6;
// }
// break;
// case LineCap.Round:
// {
// penStyleNumericUpDown.Value = 7;
// }
// break;
// case LineCap.Square:
// {
// penStyleNumericUpDown.Value = 8;
// }
// break;
// case LineCap.SquareAnchor:
// {
// penStyleNumericUpDown.Value = 9;
// }
// break;
// case LineCap.Triangle:
// {
// penStyleNumericUpDown.Value = 10;
// }
// break;
//}
}
示例4: LineFunction
public LineFunction ()
{
Width = 1;
Color = "#FFFFFF";
Opacity = 1.0m;
LineCap = LineCap.Butt;
}
示例5: _SetBaseCap
private void _SetBaseCap(LineCap baseCap)
{
int status = SafeNativeMethods.Gdip.GdipSetCustomLineCapBaseCap(new HandleRef(this, (IntPtr) this.nativeCap), baseCap);
if (status != 0)
{
throw SafeNativeMethods.Gdip.StatusException(status);
}
}
示例6: CustomLineCap
public CustomLineCap(GraphicsPath fillPath,
GraphicsPath strokePath,
LineCap baseCap, float baseInset)
{
this.fillPath = fillPath;
this.strokePath = strokePath;
this.baseCap = baseCap;
this.baseInset = baseInset;
}
示例7: CustomLineCap
public CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath, LineCap baseCap, float baseInset)
{
IntPtr zero = IntPtr.Zero;
int status = SafeNativeMethods.Gdip.GdipCreateCustomLineCap(new HandleRef(fillPath, (fillPath == null) ? IntPtr.Zero : fillPath.nativePath), new HandleRef(strokePath, (strokePath == null) ? IntPtr.Zero : strokePath.nativePath), baseCap, baseInset, out zero);
if (status != 0)
{
throw SafeNativeMethods.Gdip.StatusException(status);
}
this.SetNativeLineCap(zero);
}
示例8: f_AddPix
/// <summary>
/// 在原有波形上添加一条线
/// 不可动态循环
/// </summary>
/// <param name="listX">X轴</param>
/// <param name="listY">Y轴</param>
/// <param name="listColor">线条颜色</param>
/// <param name="listWidth">线条宽度</param>
/// <param name="listLineJoin">线条连接点</param>
/// <param name="listLineCap">线条起始线帽</param>
/// <param name="listDrawStyle">线条样式</param>
public void f_AddPix(ref List<float> listX, ref List<float> listY, Color listColor, int listWidth, LineJoin listLineJoin, LineCap listLineCap, DrawStyle listDrawStyle)
{
//装载
_listX.Add(listX);
_listY.Add(listY);
_listColor.Add(listColor);
_listWidth.Add(listWidth);
_listLineJoin.Add(listLineJoin);
_listLineCap.Add(listLineCap);
_listDrawStyle.Add(listDrawStyle);
}
示例9: CustomLineCap
public CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath, LineCap baseCap, float baseInset)
{
IntPtr fill = IntPtr.Zero;
IntPtr stroke = IntPtr.Zero;
if (fillPath != null)
fill = fillPath.nativePath;
if (strokePath != null)
stroke = strokePath.nativePath;
Status status = GDIPlus.GdipCreateCustomLineCap (fill, stroke, baseCap, baseInset, out nativeObject);
GDIPlus.CheckStatus (status);
}
示例10: f_LoadOnePix
/// <summary>
/// 清空原有数据并加载一条波形数据
/// </summary>
/// <param name="listX">X轴</param>
/// <param name="listY">Y轴</param>
/// <param name="listColor">线条颜色</param>
/// <param name="listWidth">线条宽度</param>
/// <param name="listLineJoin">线条连接点</param>
/// <param name="listLineCap">线条起始线帽</param>
/// <param name="listDrawStyle">线条样式</param>
public void f_LoadOnePix(ref List<float> listX, ref List<float> listY, Color listColor, int listWidth, LineJoin listLineJoin, LineCap listLineCap,DrawStyle listDrawStyle)
{
//重新初始化
f_ClearAllPix();
//装载
_listX.Add(listX);
_listY.Add(listY);
_listColor.Add(listColor);
_listWidth.Add(listWidth);
_listLineJoin.Add(listLineJoin);
_listLineCap.Add(listLineCap);
_listDrawStyle.Add(listDrawStyle);
}
示例11: BaseLine
public BaseLine(Color color, DashStyle dashStyle,float thickness, LineCap startLineCap, LineCap endLineCap, DashCap dashLineCap)
{
if (color == Color.White) {
this.color = Color.Black;
}
this.color = color;
this.dashStyle = dashStyle;
this.thickness = thickness;
this.startLineCap = startLineCap;
this.endLineCap = endLineCap;
this.dashLineCap = dashLineCap;
}
示例12: Pen
public Pen (Brush brush, float width)
{
_brush = (Brush)brush.Clone();;
_width = width;
_dashStyle = DashStyle.Solid;
_startCap = LineCap.Flat;
_dashCap = DashCap.Flat;
_endCap = LineCap.Flat;
_alignment = PenAlignment.Center;
_lineJoin = LineJoin.Miter;
_miterLimit = 10f;
_transform = new Matrix();
}
示例13: MapCapStyle
// Map the cap style from "System.Drawing" to "Xsharp".
private static CapStyle MapCapStyle(LineCap style)
{
switch(style)
{
case LineCap.Square:
return CapStyle.CapProjecting;
case LineCap.Flat:
return CapStyle.CapButt;
case LineCap.Round:
default:
return CapStyle.CapRound;
}
}
示例14: StrokeMath
public StrokeMath()
{
m_width = 0.5;
m_width_abs = 0.5;
m_width_eps = 0.5 / 1024.0;
m_width_sign = 1;
m_miter_limit = 4.0;
m_inner_miter_limit = 1.01;
m_approx_scale = 1.0;
m_line_cap = LineCap.Butt;
m_line_join = LineJoin.Miter;
m_inner_join = InnerJoin.Miter;
}
示例15: Stroke
// Methods
public Stroke()
{
this.pen = Pens.Black;
this.brush = new SolidColor(Color.Empty);
this.strokeColor = Color.Empty;
this.Width = 1f;
this.Linecap = LineCap.Square;
this.Linejoin = LineJoin.Miter;
this.MiterLimit = 4;
this.DashArray = null;
this.DashOffset = 0f;
this.Opacity = 1f;
}