本文整理汇总了C#中FillType类的典型用法代码示例。如果您正苦于以下问题:C# FillType类的具体用法?C# FillType怎么用?C# FillType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FillType类属于命名空间,在下文中一共展示了FillType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlaceFill
void PlaceFill( FillType fillType, Vector2 position )
{
GameObject go = null;
switch (fillType)
{
case FillType.A: go = prefabA.GetNextFree(); break;
case FillType.B: go = prefabB.GetNextFree(); break;
default:break;
}
if (go != null)
{
go.SetActive(true);
go.transform.position = position;
}
}
示例2: Init
/// <summary>
/// Generic initializer to default values
/// </summary>
private void Init()
{
color = Color.White;
brush = null;
type = FillType.None;
this.isScaled = Default.IsScaled;
this.alignH = Default.AlignH;
this.alignV = Default.AlignV;
this.rangeMin = 0.0;
this.rangeMax = 1.0;
gradientBM = null;
}
示例3: FloodFill
public void FloodFill(Player p, ushort x, ushort y, ushort z, byte b, byte oldType, FillType fillType, ref byte[] blocks, ref List<Pos> buffer)
{
try
{
Pos pos;
pos.x = x; pos.y = y; pos.z = z;
if (deep > 4000)
{
fromWhere.Add(pos);
return;
}
blocks[x + p.level.width * z + p.level.width * p.level.height * y] = b;
buffer.Add(pos);
//x
if (fillType != FillType.VerticalX)
{
if (GetTile((ushort)(x + 1), y, z, p.level, blocks) == oldType)
{
deep++;
FloodFill(p, (ushort)(x + 1), y, z, b, oldType, fillType, ref blocks, ref buffer);
deep--;
}
if (x > 0)
if (GetTile((ushort)(x - 1), y, z, p.level, blocks) == oldType)
{
deep++;
FloodFill(p, (ushort)(x - 1), y, z, b, oldType, fillType, ref blocks, ref buffer);
deep--;
}
}
//z
if (fillType != FillType.VerticalZ)
{
if (GetTile(x, y, (ushort)(z + 1), p.level, blocks) == oldType)
{
deep++;
FloodFill(p, x, y, (ushort)(z + 1), b, oldType, fillType, ref blocks, ref buffer);
deep--;
}
if (z > 0)
if (GetTile(x, y, (ushort)(z - 1), p.level, blocks) == oldType)
{
deep++;
FloodFill(p, x, y, (ushort)(z - 1), b, oldType, fillType, ref blocks, ref buffer);
deep--;
}
}
//y
if (fillType == 0 || fillType == FillType.Up || fillType > FillType.Layer)
{
if (GetTile(x, (ushort)(y + 1), z, p.level, blocks) == oldType)
{
deep++;
FloodFill(p, x, (ushort)(y + 1), z, b, oldType, fillType, ref blocks, ref buffer);
deep--;
}
}
if (fillType == 0 || fillType == FillType.Down || fillType > FillType.Layer)
{
if (y > 0)
if (GetTile(x, (ushort)(y - 1), z, p.level, blocks) == oldType)
{
deep++;
FloodFill(p, x, (ushort)(y - 1), z, b, oldType, fillType, ref blocks, ref buffer);
deep--;
}
}
} catch (Exception e) { Server.ErrorLog(e); }
}
示例4: Fill
// schema changed to 2 with addition of rangeDefault
// schema changed to 10 with version 5 refactor -- not backwards compatible
/// <summary>
/// Constructor for deserializing objects
/// </summary>
/// <param name="info">A <see cref="SerializationInfo"/> instance that defines the serialized data
/// </param>
/// <param name="context">A <see cref="StreamingContext"/> instance that contains the serialized data
/// </param>
protected Fill( SerializationInfo info, StreamingContext context )
{
Init();
// The schema value is just a file version parameter. You can use it to make future versions
// backwards compatible as new member variables are added to classes
int sch = info.GetInt32( "schema" );
_color = (Color) info.GetValue( "color", typeof(Color) );
_secondaryValueGradientColor = (Color) info.GetValue( "secondaryValueGradientColor", typeof( Color ) );
//brush = (Brush) info.GetValue( "brush", typeof(Brush) );
//brushHolder = (BrushHolder) info.GetValue( "brushHolder", typeof(BrushHolder) );
_type = (FillType) info.GetValue( "type", typeof(FillType) );
_isScaled = info.GetBoolean( "isScaled" );
_alignH = (AlignH) info.GetValue( "alignH", typeof(AlignH) );
_alignV = (AlignV) info.GetValue( "alignV", typeof(AlignV) );
_rangeMin = info.GetDouble( "rangeMin" );
_rangeMax = info.GetDouble( "rangeMax" );
//BrushHolder brushHolder = (BrushHolder) info.GetValue( "brushHolder", typeof( BrushHolder ) );
//brush = brush;
_colorList = (Color[]) info.GetValue( "colorList", typeof(Color[]) );
_positionList = (float[]) info.GetValue( "positionList", typeof(float[]) );
_angle = info.GetSingle( "angle" );
_image = (Image) info.GetValue( "image", typeof(Image) );
_wrapMode = (WrapMode) info.GetValue( "wrapMode", typeof(WrapMode) );
if ( _colorList != null && _positionList != null )
{
ColorBlend blend = new ColorBlend();
blend.Colors = _colorList;
blend.Positions = _positionList;
CreateBrushFromBlend( blend, _angle );
}
else if ( _image != null )
{
_brush = new TextureBrush( _image, _wrapMode );
}
_rangeDefault = info.GetDouble( "rangeDefault" );
}
示例5: EditFill
public void EditFill(FillType fill_type)
{
if (!gimp_edit_fill(ID, fill_type))
{
throw new GimpSharpException();
}
}
示例6: FillRectangle
/// <summary>
/// Renders a rectangular background portion of a control.
/// </summary>
protected virtual void FillRectangle(Coord relPos, Coord size, Corner rounded, FillType fillType, HitState hitState, AnchorLocation location)
{
var point = Context.Push();
var coord = new Coord(point.X + relPos.X, point.Y + relPos.Y);
switch (fillType)
{
case FillType.Background:
Context.Cairo.Pattern = GenerateGradient(coord, size, location,
GetColor(ColorType.BackgroundStart, hitState),
GetColor(ColorType.BackgroundStop, hitState));
break;
case FillType.Editable:
Context.Cairo.Pattern = GenerateGradient(coord, size, location,
GetColor(ColorType.EditableStart, hitState),
GetColor(ColorType.EditableStop, hitState));
break;
case FillType.Highlight:
Context.Cairo.Pattern = GenerateGradient(coord, size, location,
GetColor(ColorType.HighlightStart, hitState),
GetColor(ColorType.HighlightStop, hitState));
break;
case FillType.Selection:
Context.Cairo.Color = SelectionColor.ToCairo();
break;
}
// draw the rectangle
Context.Cairo.Operator = Cairo.Operator.Source;
RectanglePath(coord.Round + 1, size.Floor - 2, rounded);
Context.Cairo.Fill();
Context.Pop();
}
示例7: Setup_BeforeAdd
public override void Setup_BeforeAdd(XML xml)
{
base.Setup_BeforeAdd(xml);
string str;
str = xml.GetAttribute("url");
if (str != null)
_url = str;
str = xml.GetAttribute("align");
if (str != null)
_align = FieldTypes.ParseAlign(str);
str = xml.GetAttribute("vAlign");
if (str != null)
_verticalAlign = FieldTypes.ParseVerticalAlign(str);
str = xml.GetAttribute("fill");
if (str != null)
_fill = FieldTypes.ParseFillType(str);
_autoSize = xml.GetAttributeBool("autoSize", false);
str = xml.GetAttribute("errorSign");
if (str != null)
showErrorSign = str == "true";
_playing = xml.GetAttributeBool("playing", true);
str = xml.GetAttribute("color");
if (str != null)
this.color = ToolSet.ConvertFromHtmlColor(str);
if (_url != null)
LoadContent();
}
示例8: Fill
/// <summary>
/// Constructor that creates a linear gradient color-fill, setting <see cref="Type"/> to
/// <see cref="FillType.Brush"/> using the specified colors and angle.
/// </summary>
/// <param name="color1">The first color for the gradient fill</param>
/// <param name="color2">The second color for the gradient fill</param>
/// <param name="angle">The angle (degrees) of the gradient fill</param>
public Fill(Color color1, Color color2, float angle)
{
Init();
_color = color2;
var blend = new ColorBlend(2);
blend.Colors[0] = color1;
blend.Colors[1] = color2;
blend.Positions[0] = 0.0f;
blend.Positions[1] = 1.0f;
_type = FillType.Brush;
CreateBrushFromBlend(blend, angle);
}
示例9: ExtFloodFill
public static extern bool ExtFloodFill([In] IntPtr hdc, int x, int y, uint color, FillType type);
示例10: BitmapFill
public BitmapFill(uint characterId, Matrix matrix, FillType fillType)
{
this.CharacterId = characterId;
this.Matrix = matrix;
this.fillType = fillType;
}
示例11: Fill
public void Fill(FillType fill_type)
{
if (!gimp_drawable_fill(ID, fill_type))
{
throw new GimpSharpException();
}
}
示例12: gimp_drawable_fill
static extern bool gimp_drawable_fill(Int32 drawable_ID,
FillType fill_type);
示例13: BuildFillType
private static string BuildFillType(FillType fillType)
{
return fillType == FillType.Null ? String.Empty : String.Format(QueryStatements.Fill, fillType.ToString().ToLower());
}
示例14: Setup_BeforeAdd
public override void Setup_BeforeAdd(XML xml)
{
base.Setup_BeforeAdd(xml);
string str;
str = xml.GetAttribute("url");
if (str != null)
_url = str;
str = xml.GetAttribute("align");
if (str != null)
_align = FieldTypes.ParseAlign(str);
str = xml.GetAttribute("vAlign");
if (str != null)
_verticalAlign = FieldTypes.ParseVerticalAlign(str);
str = xml.GetAttribute("fill");
if (str != null)
_fill = FieldTypes.ParseFillType(str);
_autoSize = xml.GetAttributeBool("autoSize", false);
str = xml.GetAttribute("errorSign");
if (str != null)
showErrorSign = str == "true";
_playing = xml.GetAttributeBool("playing", true);
str = xml.GetAttribute("color");
if (str != null)
this.color = ToolSet.ConvertFromHtmlColor(str);
str = xml.GetAttribute("fillMethod");
if (str != null)
_content.fillMethod = FieldTypes.ParseFillMethod(str);
if (_content.fillMethod != FillMethod.None)
{
_content.fillOrigin = xml.GetAttributeInt("fillOrigin");
_content.fillClockwise = xml.GetAttributeBool("fillClockwise", true);
_content.fillAmount = (float)xml.GetAttributeInt("fillAmount", 100) / 100;
}
if (_url != null)
LoadContent();
}
示例15: Init
private void Init( string family, float size, Color color, bool isBold,
bool isItalic, bool isUnderline, Color fillColor, Brush fillBrush,
FillType fillType )
{
_fontColor = color;
_family = family;
_isBold = isBold;
_isItalic = isItalic;
_isUnderline = isUnderline;
_size = size;
_angle = 0F;
_isAntiAlias = Default.IsAntiAlias;
_stringAlignment = Default.StringAlignment;
_isDropShadow = Default.IsDropShadow;
_dropShadowColor = Default.DropShadowColor;
_dropShadowAngle = Default.DropShadowAngle;
_dropShadowOffset = Default.DropShadowOffset;
_scaleFactor = Default.ScaleFactor;
_fill = new Fill( fillColor, fillBrush, fillType );
_border = new Border( true, Color.Black, 1.0F );
_scaledSize = -1;
Remake( 1.0F, _size, ref _scaledSize, ref _font );
}