Nevron Forum

Hatch

https://www.nevron.com/Forum/Topic4065.aspx

By Volvick Derose 1 - Monday, August 30, 2010

I try to create a composite shape, I wonder if it is possible to apply a hatch to an NRectangularPath, I keep getting error when I try it.

Something like this

NRectanglePath myShape= new NRectanglePath(150, 475, 300, 25);
myShape.Style.FillStyle = new NHatchFillStyle(HatchStyle.HorizontalBrick, Color.White, Color.Black);//error here
By Nevron Support - Monday, August 30, 2010

Hi,

The style of a shape is set to null by default and that's why we recommend when applying styles you always use the following syntax:

NStyle.SetFillStyle(shape, fillStyle);

By Volvick Derose 1 - Monday, August 30, 2010

works fine, however when I try to set the texture mapping scale, there is no effect.  Here is the code

 

NHatchFillStyle hatchStyle = new NHatchFillStyle(HatchStyle.HorizontalBrick, Color.White, Color.Black);

NTextureMappingStyle mappingStyle = new NTextureMappingStyle();

mappingStyle.MapMode = MapMode.RelativeToViewer;

mappingStyle.MapLayout = MapLayout.Tiled;

mappingStyle.HorizontalScale = 10.0f;

mappingStyle.VerticalScale = 10.0f;

hatchStyle.TextureMappingStyle = mappingStyle;

NStyle.SetFillStyle(myShape, hatchStyle);

It shows no effect on applying the scale