本文整理汇总了C#中XYZ.Add方法的典型用法代码示例。如果您正苦于以下问题:C# XYZ.Add方法的具体用法?C# XYZ.Add怎么用?C# XYZ.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XYZ
的用法示例。
在下文中一共展示了XYZ.Add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImageTag
public void ImageTag(Document doc, SheetInfo info, ViewPortInfo vport)
{
// Create a new QRCoder Tag
QRCoder.QRCodeGenerator qrGenerator = new QRCoder.QRCodeGenerator();
// Generate a new QR Tag
QRCoder.QRCodeGenerator.QRCode qrCode = qrGenerator.CreateQrCode(data, QRCoder.QRCodeGenerator.ECCLevel.M);
// Assemble a temp file name
string tempfile = System.IO.Path.GetTempFileName() + ".QRTAG";
// Get the Tags graphics element
System.Drawing.Bitmap bmp = qrCode.GetGraphic(5);
// Save it temporarily
bmp.Save(tempfile);
// Get the related view sheet
View sheet = (View)doc.GetElement(info.sheetId);
// Create a image element to return from import
Element imageElement = null;
// Get the Viewports label outline
Outline labelOutline = vport.vport.GetLabelOutline();
// Get the lower left corner
XYZ labelCorner = new XYZ(info.sheet.Origin.X + (labelOutline.MinimumPoint.X), info.sheet.Origin.Y + labelOutline.MinimumPoint.Y, 0);
// Add some distance value
XYZ location = labelCorner.Add(new XYZ(0, -0.5/12.0, 0));
// Import the image
doc.Import(tempfile, new ImageImportOptions() { RefPoint = location, Placement = BoxPlacement.TopLeft }, sheet, out imageElement);
// Delete temp file
if (System.IO.File.Exists(tempfile)) System.IO.File.Delete(tempfile);
}
示例2: Evaluate
public override Value Evaluate(FSharpList<Value> args)
{
if (!args[0].IsList)
throw new Exception("A list of XYZs is required to average.");
FSharpList<Value> lst = ((Value.List)args[0]).Item;
XYZ average = new XYZ();
foreach (Value v in lst)
{
XYZ pt = (XYZ)((Value.Container)v).Item;
average = average.Add(pt);
}
average = average.Divide(lst.Count<Value>());
pts.Add(average);
return Value.NewContainer(average);
}