![]() | MeasureItemSetStyle Method |
Namespace: VIZCore3DX.NET.Data
public void SetStyle( MeasureCustomStyle customStyle )
// VIZCore3DX.NET Control private VIZCore3DX.NET.VIZCore3DXControl vizcore3dx; private void Example() { List<Data.MeasureItem> items = vizcore3dx.Measure.Measures; // Get Style Data.MeasureItem item = items[0]; System.Drawing.Color boxFillColor = item.CustomStyle.BoxFillColor; System.Drawing.Color boxStrokeColor = item.CustomStyle.BoxStrokeColor; System.Drawing.Color textColor = item.CustomStyle.TextColor; System.Drawing.Color lineStrokeColor = item.CustomStyle.LineStrokeColor; Data.StrokePattern lineStrokePattern = item.CustomStyle.LineStrokePattern; float lineStrokeThickness = item.CustomStyle.LineStrokeThickness; Data.TextSizeType textSize = item.CustomStyle.TextSize; Data.AreaUnit areaUnit = item.CustomStyle.AreaUnit; byte decimalPlace = item.CustomStyle.DecimalPlace; bool isAxisDistanceEnabled = item.CustomStyle.IsAxisDistanceEnabled; bool isGridCoordinateEnabled = item.CustomStyle.IsGridCoordinateEnabled; bool isTypeEnabled = item.CustomStyle.IsTypeEnabled; bool isUnitEnabled = item.CustomStyle.IsUnitEnabled; Data.LengthUnit lengthUnit = item.CustomStyle.LengthUnit; // Set Style Data.MeasureCustomStyle customStyle = item.CustomStyle; customStyle.BoxFillColor = Color.Green; customStyle.BoxStrokeColor = Color.Red; customStyle.TextColor = Color.White; customStyle.TextSize = Data.TextSizeType.Size_24; customStyle.LineStrokeColor = Color.Green; customStyle.LineStrokePattern = StrokePattern.Solid; customStyle.LineStrokeThickness = 30; customStyle.AreaUnit = Data.AreaUnit.SquareCentimeter; customStyle.DecimalPlace = 4; customStyle.IsAxisDistanceEnabled = true; customStyle.IsGridCoordinateEnabled = true; customStyle.IsTypeEnabled = true; customStyle.IsUnitEnabled = true; customStyle.LengthUnit = Data.LengthUnit.Centimeter; item.SetStyle(customStyle); }