Nevron .NET Vision
Nevron.GraphicsCore Namespace / NStrokeStyle Class / Pattern Property
Example


In This Topic
    Pattern Property (NStrokeStyle)
    In This Topic
    Defines the line pattern.
    Syntax
    'Declaration
     
    
    <System.Xml.Serialization.XmlAttributeAttribute()>
    <System.ComponentModel.DefaultValueAttribute(Mono.Cecil.CustomAttributeArgument)>
    Public Property Pattern As LinePattern
    'Usage
     
    
    Dim instance As NStrokeStyle
    Dim value As LinePattern
     
    instance.Pattern = value
     
    value = instance.Pattern
    [System.Xml.Serialization.XmlAttribute()]
    [System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)]
    public LinePattern Pattern {get; set;}
    Remarks
    The Pattern and Factor properties define the line by working together to define whether a certain pixel from the line should be drawn or not. The values of the LinePattern enumeration actually represent 16-bit integers whose bit pattern determines which fragments of a line will be drawn when the line is rasterized. Bit zero is used first. For example the value of SolidLine is all ones (0xFFFF). You can create you own patterns by simply setting the bits of the short integer value that you want the line to draw. Suppose for example that you want to draw a line having three empty pixels, then one black then three empty and so forth. The value you should pass to the LinePattern in this case is 0x8888 or in binary 1000100010001000. You must also set the Factor property to 1.
    Example
    The following example shows how to accomplish this:
    strokeStyle.Color = System.Drawing.Color.Black
    strokeStyle.Pattern = CType(0x8888, LinePattern)
    strokeStyle.Factor = 1
    strokeStyle.Color = System.Drawing.Color.Black;
    strokeStyle.Pattern = (LinePattern)0x8888;
    strokeStyle.Factor = 1;
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also