本文整理汇总了C#中Procedure.Run方法的典型用法代码示例。如果您正苦于以下问题:C# Procedure.Run方法的具体用法?C# Procedure.Run怎么用?C# Procedure.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Procedure
的用法示例。
在下文中一共展示了Procedure.Run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetImageFromGoogleCharts
Image GetImageFromGoogleCharts(Dimensions dimensions)
{
var chl = "&chl=" + Uri.EscapeDataString(GetValue<string>("text"));
var chs = string.Format("&chs={0}x{1}", dimensions.Width,
dimensions.Height);
var choe = "&choe=" + GetEncodingString();
var chld = string.Format("&chld={0}|{1}", GetValue<string>("error_correction"),
GetValue<int>("margin"));
var url = "http://chart.apis.google.com/chart?cht=qr"
+ chl + chs + choe + chld;
var procedure = new Procedure("file-uri-load");
try
{
var returnArgs = procedure.Run(url, url);
return returnArgs[0] as Image;
}
catch (GimpSharpException e)
{
new Message(e.Message);
return null;
}
}
示例2: Render
public void Render(Image image, Drawable drawable, bool preview)
{
int size = GetValue<int>("size");
image.UndoGroupStart();
var procedure = new Procedure("plug_in_pixelize");
procedure.Run(image, drawable, size);
var palette = new MinisteckPalette();
image.ConvertIndexed(ConvertDitherType.No, ConvertPaletteType.Custom,
0, false, false, "Ministeck");
palette.Delete();
image.ConvertRgb();
image.UndoGroupEnd();
// And finally calculate the Ministeck pieces
using (var painter = new Painter(drawable, size, GetValue<RGB>("color")))
{
Shape.Painter = painter;
int width = drawable.Width / size;
int height = drawable.Height / size;
var A = new BoolMatrix(width, height);
// Fill in shapes
bool limit = GetValue<bool>("limit");
var shapes = new ShapeSet();
shapes.Add((limit) ? 2 : 1, new TwoByTwoShape());
shapes.Add((limit) ? 8 : 1, new ThreeByOneShape());
shapes.Add((limit) ? 3 : 1, new TwoByOneShape());
shapes.Add((limit) ? 2 : 1, new CornerShape());
shapes.Add((limit) ? 1 : 1, new OneByOneShape());
Action<int> update = null;
if (!preview)
{
var progress = new Progress(_("Ministeck..."));
update = y => progress.Update((double) y / height);
}
var generator =
new CoordinateGenerator(new Rectangle(0, 0, width, height), update);
generator.ForEach(c => {if (!A.Get(c)) shapes.Fits(A, c);});
}
drawable.Flush();
drawable.Update();
}
示例3: RunProcedure
protected void RunProcedure(string name, Image image, Drawable drawable,
params object[] list)
{
var procedure = new Procedure(name);
procedure.Run(image, drawable, list);
}