本文整理汇总了C#中FillMode类的典型用法代码示例。如果您正苦于以下问题:C# FillMode类的具体用法?C# FillMode怎么用?C# FillMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FillMode类属于命名空间,在下文中一共展示了FillMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetDEMFillMode
public void SetDEMFillMode(FillMode fillMode)
{
lock (gDevice)
{
demFillMode = fillMode;
}
}
示例2: BeginModify
public void BeginModify(FillMode fillmode)
{
if(m_geometryFilled)
CreatePathGeometry();
m_geometrySink = m_pathGeometry.Open();
m_geometrySink.SetFillMode((SlimDX.Direct2D.FillMode)fillmode);
}
示例3: CreateCubical
/// <summary>
/// Create objects in a cubical patern
/// </summary>
/// <param name="item">the GameObject to be placed in our cubic patern</param>
/// <param name="item2">the second type of GameObject to be placed in empty places of our patern (instead of being empty)</param>
/// <param name="position">position of the corner of the cube</param>
/// <param name="width">width of the cube</param>
/// <param name="height">height of the cube</param>
/// <param name="depth">depth of the cube</param>
/// <param name="tileSize">size of each tile of the cube (i.e distance between items)</param>
/// <param name="fill">fill mode of the cube</param>
/// <returns>returns if it was successful or not</returns>
public static bool CreateCubical(GameObject item, GameObject item2, Vector3 position, float width, float height, float depth, float tileSize, FillMode fill)
{
if (item == null || width <= 0 || height <= 0 || depth <= 0 || tileSize <= 0)
{
return false;
}
//some modes can not tolerate even numbers
if (fill == FillMode.YesNo)
{
if (width % 2 == 0) width++;
if (height % 2 == 0) height++;
if (depth % 2 == 0) depth++;
}
currentPosition = position;
for (int i = 0; i < width; i++)
{
for (int j = 0; j < height; j++)
{
for (int k = 0; k < depth; k++)
{
if (fill == FillMode.fill)
{
GameObject.Instantiate(item, currentPosition, Quaternion.identity);
}
else if (fill == FillMode.empty)
{
if (i == 0 || j == 0 || k == 0 || i == width - 1 || j == height - 1 || k == depth - 1)
{
GameObject.Instantiate(item, currentPosition, Quaternion.identity);
}
else if (item2 != null)
{
GameObject.Instantiate(item2, currentPosition, Quaternion.identity);
}
}
else if (fill == FillMode.YesNo)
{
if ((i % 2 == 0 && j % 2 == 0 && k % 2 == 0) || i == 0 || j == 0 || k == 0 || i == width - 1 || j == height - 1 || k == depth - 1)
{
GameObject.Instantiate(item, currentPosition, Quaternion.identity);
}
else if (item2 != null)
{
GameObject.Instantiate(item2, currentPosition, Quaternion.identity);
}
}
currentPosition.z += tileSize;
}
currentPosition.y += tileSize;
currentPosition.z = position.z;
}
currentPosition.x += tileSize;
currentPosition.y = position.y;
currentPosition.z = position.z;
}
return true;
}
示例4: Page
/// <summary>
/// </summary>
/// <param name="parent"> </param>
/// <param name="title"> </param>
public Page(Version parent, string title)
{
Title = title;
_parent = parent;
if (parent != null)
_parent.Pages.Add(this);
_items = new List<IOption>();
_fillMode = FillMode.TopToBottom;
}
示例5: ProduceNewFillStyleInfo
public IFillStyleInfo ProduceNewFillStyleInfo(
Color FillColor,
Color GradientColor,
FillMode mode)
{
IFillStyleInfo NewFillStyle = new GDIFillStyle(
FillColor, GradientColor, mode);
return NewFillStyle;
}
示例6: GraphicsPath
public GraphicsPath(FillMode fillMode) {
IntPtr nativePath = IntPtr.Zero;
int status = SafeNativeMethods.Gdip.GdipCreatePath(unchecked((int)fillMode), out nativePath);
if (status != SafeNativeMethods.Gdip.Ok)
throw SafeNativeMethods.Gdip.StatusException(status);
this.nativePath = nativePath;
}
示例7: SmoothProgressBar
public SmoothProgressBar()
{
InitializeComponent();
m_min = 0;
m_max = 100;
m_value = 0;
m_fillMode = FillMode.LEFT_TO_RIGHT;
m_text = "";
m_txtColor = SystemColors.WindowText;
}
示例8: GraphicsPath
public GraphicsPath (PointF[] pts, byte[] types, FillMode fillMode)
{
if (pts == null)
throw new ArgumentNullException ("pts");
if (pts.Length != types.Length)
throw new ArgumentException ("Invalid parameter passed. Number of points and types must be same.");
Status status = GDIPlus.GdipCreatePath2 (pts, types, pts.Length, fillMode, out nativePath);
GDIPlus.CheckStatus (status);
}
示例9: RenderInfo
public RenderInfo(Mesh mesh, int subset, Matrix transform, NJS_MATERIAL material, Texture texture, FillMode fillMode, BoundingSphere bounds)
{
Mesh = mesh;
Subset = subset;
Transform = transform;
Material = material;
Texture = texture;
FillMode = fillMode;
Bounds = bounds;
}
示例10: Simplify
public static List<List<Vector2>> Simplify(List<Vector2> polygon, FillMode fillMode, out PolyTree tree)
{
Clipper.Clear();
Clipper.AddPath(polygon, PolyType.ptSubject, true);
Clipper.AddPath(polygon, PolyType.ptClip, true);
tree = new PolyTree();
PolyFillType fillType = fillMode.ToPolyFillType();
Clipper.Execute(ClipType.ctUnion, tree, fillType, fillType);
return Clipper.ClosedPathsFromPolyTree(tree);
}
示例11: Version
/// <summary>
/// </summary>
/// <param name="parent"> </param>
/// <param name="title"> </param>
public Version(Menu parent, string title)
{
Title = title;
_parent = parent;
if (parent != null)
_parent.Versions.Add(this);
_number = 0.0f;
_items = new List<IOption>();
_pages = new List<Page>();
_fillMode = FillMode.TopToBottom;
}
示例12: Combine
public static List<List<Vector2>> Combine(List<List<Vector2>> subjectPolygons, List<List<Vector2>> clippingPolygons,
FillMode subjectFillMode, FillMode clipFillMode, CombineMode combineMode, out PolyTree tree)
{
Clipper.Clear();
Clipper.AddPaths(subjectPolygons, PolyType.ptSubject, true);
Clipper.AddPaths(clippingPolygons, PolyType.ptClip, true);
tree = new PolyTree();
Clipper.Execute(combineMode.ToClipType(), tree, subjectFillMode.ToPolyFillType(), clipFillMode.ToPolyFillType());
return Clipper.ClosedPathsFromPolyTree(tree);
}
示例13: Create
/// <summary>
/// Creates a new instance of the rasterizer state.
/// </summary>
/// <param name="cullMode"></param>
/// <param name="fillMode"></param>
/// <param name="depthBias"></param>
/// <param name="slopeDepthBias"></param>
/// <returns></returns>
public static RasterizerState Create ( CullMode cullMode, FillMode fillMode = FillMode.Solid, int depthBias = 0, float slopeDepthBias = 0 )
{
var rs = new RasterizerState();
rs.CullMode = cullMode;
rs.DepthBias = depthBias;
rs.SlopeDepthBias = slopeDepthBias;
rs.MsaaEnabled = true;
rs.FillMode = fillMode;
rs.DepthClipEnabled = true;
rs.ScissorEnabled = false;
return rs;
}
示例14: Outline
public static List<List<Vector2>> Outline(List<Vector2> polygon, FillMode fillMode, bool closed, StrokeStyle strokeStyle, float strokeWidth, out PolyTree tree)
{
List<List<Vector2>> simplified = Clipper.SimplifyPolygon(polygon, fillMode.ToPolyFillType());
Offsetter.Clear();
Offsetter.MiterLimit = strokeStyle.MiterLimit;
Offsetter.AddPaths(simplified, (JoinType)strokeStyle.LineJoin, closed ? EndType.etClosedLine : strokeStyle.CapStyle.ToEndType());
tree = new PolyTree();
Offsetter.Execute(ref tree, strokeWidth / 2);
return Clipper.ClosedPathsFromPolyTree(tree);
}
示例15: GraphicsPath
public GraphicsPath(Point[] pts, byte[] types, FillMode fillMode)
{
if(pts == null)
{
throw new ArgumentNullException("pts");
}
if(types == null)
{
throw new ArgumentNullException("types");
}
this.fillMode = fillMode;
// TODO: convert the pts and types arrays
}