本文整理汇总了C#中Layer.Fill方法的典型用法代码示例。如果您正苦于以下问题:C# Layer.Fill方法的具体用法?C# Layer.Fill怎么用?C# Layer.Fill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layer
的用法示例。
在下文中一共展示了Layer.Fill方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override bool Execute()
{
// Fix me: do something with Image.ImageBaseType
var image = ActiveImage;
var layer = new Layer(image, "Background", ImageType.Rgba);
image.InsertLayer(layer, 0);
image.ActiveLayer = layer;
SelectedLayer = layer;
layer.Fill(FillType.Background);
return true;
}
示例2: Execute
public override bool Execute()
{
var image = ActiveImage;
_layerNr++;
var layer = new Layer(image, "Color Fill " + _layerNr, ImageType.Rgba);
image.InsertLayer(layer, 0);
image.ActiveLayer = layer;
SelectedLayer = layer;
Context.Push();
Context.Foreground = _clr.GetColor();
layer.Fill(FillType.Foreground);
Context.Pop();
return true;
}
示例3: Execute
public override bool Execute()
{
ImageBaseType type = ImageBaseType.Rgb; // Fix me!
switch (_mode.Value)
{
case "Grys":
type = ImageBaseType.Gray;
break;
default:
Console.WriteLine("Type: " + _mode.Value);
type = ImageBaseType.Rgb;
break;
}
int width = (int) (Parameters["Wdth"] as DoubleParameter).GetPixels(0);
int height = (int) (Parameters["Hght"] as DoubleParameter).GetPixels(0);
ImageType imageType;
FillType fillType;
switch (_fill.Value)
{
case "Trns":
imageType = (type == ImageBaseType.Gray)
? ImageType.Graya : ImageType.Rgba;
fillType = FillType.Transparent;
break;
default:
imageType = (type == ImageBaseType.Gray)
? ImageType.Gray : ImageType.Rgb;
fillType = FillType.White;
break;
}
var image = new Image(width, height, type);
var layer = new Layer(image, "Layer 1", width, height, imageType);
image.InsertLayer(layer, 0);
layer.Fill(fillType);
ActiveImage = image;
ActiveDrawable = layer;
new Display(image);
return true;
}
示例4: Execute
public override bool Execute()
{
var image = ActiveImage;
var name = _name ?? GetNextUnnamedLayer();
ImageType imageType;
switch (image.BaseType)
{
case ImageBaseType.Rgb:
imageType = ImageType.Rgba;
break;
case ImageBaseType.Gray:
imageType = ImageType.Gray;
break;
default:
imageType = ImageType.Rgba;
break;
}
var layer = new Layer(image, name, imageType, 100, GetMode());
image.InsertLayer(layer, 0);
image.ActiveLayer = layer;
SelectedLayer = layer;
layer.Fill(FillType.Transparent);
return true;
}