本文整理汇总了C#中Drawing类的典型用法代码示例。如果您正苦于以下问题:C# Drawing类的具体用法?C# Drawing怎么用?C# Drawing使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Drawing类属于命名空间,在下文中一共展示了Drawing类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveDrawing
public static void SaveDrawing(Drawing drawing, Stream stream)
{
using (var writer = XmlWriter.Create(stream, XmlSettings))
{
SaveDrawing(drawing, writer);
}
}
示例2: Analyze
public void Analyze(Drawing[] drawings)
{
Console.Write("Enter your numbers:");
string s = Console.ReadLine();
var nums = (from sP in s.Split(',')
select Int32.Parse(sP)).ToArray();
var result =
from drawing in drawings
let matches = drawing.Where(d => nums.Contains(d))
where matches.Count() > 2
let matchedNums =
string.Join(",",
matches.OrderBy(i => i).Select(i => i.ToString()).ToArray())
let elem = new {matches, matchedNums, drawing.DayOfDraw}
group elem by elem.matchedNums
into m
orderby m.Key.Length descending
let date = m.Count() > 1 ?
"Various" : m.FirstOrDefault().DayOfDraw.ToString("dd.MM.yyyy")
select new
{
Numbers = "[" + m.Key + "]",
Hits = m.Count(),
DrawDate = date
};
foreach (var a in result)
Console.WriteLine("Numbers: {0} were drawn {1} times on {2}", a.Numbers, a.Hits, a.DrawDate);
}
示例3: ShowFilesViewer
public void ShowFilesViewer(Drawing drawing)
{
var filesController = Factory.GetFilesViewController();
filesController.Files = drawing.Files;
filesController.ShowFilesView();
}
示例4: PieSlice
public PieSlice(Drawing.Point p0, double r, double start, double end)
{
this.Center = p0;
this.Radius = r;
this.Start = start;
this.End = end;
}
示例5: SetViewRect
public static void SetViewRect(
this IVisio.Window window,
Drawing.Rectangle rect)
{
// MSDN: http://msdn.microsoft.com/en-us/library/office/ms367542(v=office.14).aspx
window.SetViewRect(rect.Left, rect.Top, rect.Width, rect.Height);
}
示例6: AddTabBorder
public override void AddTabBorder(Drawing.Drawing2D.GraphicsPath path, Drawing.Rectangle tabBounds)
{
switch (tabControl.Alignment)
{
case TabAlignment.Top:
path.AddLine(tabBounds.X, tabBounds.Bottom, tabBounds.X, tabBounds.Y);
path.AddLine(tabBounds.X, tabBounds.Y, tabBounds.Right, tabBounds.Y);
path.AddLine(tabBounds.Right, tabBounds.Y, tabBounds.Right, tabBounds.Bottom);
break;
case TabAlignment.Bottom:
path.AddLine(tabBounds.Right, tabBounds.Y, tabBounds.Right, tabBounds.Bottom);
path.AddLine(tabBounds.Right, tabBounds.Bottom, tabBounds.X, tabBounds.Bottom);
path.AddLine(tabBounds.X, tabBounds.Bottom, tabBounds.X, tabBounds.Y);
break;
case TabAlignment.Left:
path.AddLine(tabBounds.Right, tabBounds.Bottom, tabBounds.X, tabBounds.Bottom);
path.AddLine(tabBounds.X, tabBounds.Bottom, tabBounds.X, tabBounds.Y);
path.AddLine(tabBounds.X, tabBounds.Y, tabBounds.Right, tabBounds.Y);
break;
case TabAlignment.Right:
path.AddLine(tabBounds.X, tabBounds.Y, tabBounds.Right, tabBounds.Y);
path.AddLine(tabBounds.Right, tabBounds.Y, tabBounds.Right, tabBounds.Bottom);
path.AddLine(tabBounds.Right, tabBounds.Bottom, tabBounds.X, tabBounds.Bottom);
break;
}
}
示例7: DrawLine
public DrawLine(Drawing drawing, Window window)
{
this.drawing = drawing;
this.window = window;
testName = AssemblyExtensions.GetTestNameOrProjectName();
material = new Material(ShaderFlags.Position2DColored, "");
}
示例8: OnAddingToDrawing
public override void OnAddingToDrawing(Drawing drawing)
{
// Recalculate in order to compile expressions and have accurate coordinates.
// Needed when autoLabelPoints is on. -D.H.
Recalculate();
base.OnAddingToDrawing(drawing);
}
示例9: OpenTKImage
public OpenTKImage(string filename, Drawing drawing)
: base(filename, drawing)
{
InitializeTextureHandle();
TryLoadBitmapFile("Content/" + filename + ".png");
SetSamplerState();
}
示例10: Analyze
public void Analyze(Drawing[] drawings)
{
var result =
from d in drawings
group d by d.DayOfDraw.Year
into years
select new
{
Year = years.Key,
Numbers =
(from d in years
from n in d
group d by n into numbers
orderby numbers.Count() descending
select new { Number = numbers.Key, Hits = numbers.Count() })
.Take(10)
};
foreach (var a in result)
{
Console.WriteLine("In the year {0} the most popular numbers were", a.Year);
foreach (var n in a.Numbers)
Console.WriteLine("{0,2} : {1} hits", n.Number, n.Hits);
}
}
示例11: showPolygon
public static void showPolygon()
{
Drawing d = new Drawing();
d.MaximalVisibleX = 55;
d.MinimalVisibleX = -5;
d.MaximalVisibleY = 55;
d.MinimalVisibleY = -5;
List<Point<double>> points = new List<Point<double>>();
points.Add(new Point<double>(16, 27));
points.Add(new Point<double>(36, 18));
points.Add(new Point<double>(39, 9));
points.Add(new Point<double>(29, 4));
points.Add(new Point<double>(17, 7));
points.Add(new Point<double>(11, 12));
points.Add(new Point<double>(7, 15));
points.Add(new Point<double>(2, 14));
points.Add(new Point<double>(2, 16));
points.Add(new Point<double>(4, 23));
points.Add(new Point<double>(26, 11));
points.Add(new Point<double>(31, 16));
d.Polygons.Add(points);
// GeomXmlWriter.Save(d, @"C:\Users\thresh\Documents\e.lgf");
}
示例12: WriteToDrawingsStandartsRates
public void WriteToDrawingsStandartsRates(Drawing drawing)
{
var finded =
GetListCollection().FirstOrDefault(x => x.Equals(drawing));
WriteToDrawingsStandartsRates(drawing, finded);
}
示例13: ShowToolTip
public static void ShowToolTip( Drawing.ColorTable colorTable, SuperToolTipInfo info, Control owner, Point p, bool balloon )
{
if( _suppressCount != 0 || WinFormsUtility.Events.MenuLoop.InMenuLoop )
{
return;
}
if( _existing != null )
{
if( object.Equals( _existing.Info, info ) )
{
return;
}
else
{
_existing.Close();
_existing = null;
}
}
_mousePoint = Control.MousePosition;
_existing = new SuperToolTip( colorTable, info, p, balloon );
_existing.Show( owner );
}
示例14: GenerateColors
public override void GenerateColors(Drawing.Color[] outputColors, int startIndex, int x, int y, int len)
{
int bytesBetweenPixelsInclusive = srcRW.BytesBetweenPixelsInclusive;
ISpanInterpolator spanInterpolator = Interpolator;
spanInterpolator.Begin(x + dx, y + dy, len);
int x_hr;
int y_hr;
spanInterpolator.GetCoord(out x_hr, out y_hr);
int x_lr = x_hr >> img_subpix_const.SHIFT;
int y_lr = y_hr >> img_subpix_const.SHIFT;
int bufferIndex;
bufferIndex = srcRW.GetBufferOffsetXY(x_lr, y_lr);
byte[] srcBuff = srcRW.GetBuffer();
unsafe
{
fixed (byte* pSource = srcBuff)
{
do
{
outputColors[startIndex].red = pSource[bufferIndex];
outputColors[startIndex].green = pSource[bufferIndex];
outputColors[startIndex].blue = pSource[bufferIndex];
outputColors[startIndex].alpha = 255;
startIndex++;
bufferIndex += bytesBetweenPixelsInclusive;
} while (--len != 0);
}
}
}
示例15: DwgEditor
public DwgEditor(Drawing dwg)
{
Dwg = dwg;
Mode = EDwgMode.Line;
ClipToBounds = true;
Focusable = true;
}