当前位置: 首页>>代码示例>>C#>>正文


C# Drawing类代码示例

本文整理汇总了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);
     }
 }
开发者ID:ondrej11,项目名称:o106,代码行数:7,代码来源:DrawingSerializer.cs

示例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);

    }
开发者ID:flq,项目名称:Rf.Lotto,代码行数:31,代码来源:FindYourHits.cs

示例3: ShowFilesViewer

        public void ShowFilesViewer(Drawing drawing)
        {
            var filesController = Factory.GetFilesViewController();
            filesController.Files = drawing.Files;
            filesController.ShowFilesView();

        }
开发者ID:ctukc-nt,项目名称:UPPY_v2,代码行数:7,代码来源:DrawingHistoryController.cs

示例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;
 }
开发者ID:shekharssorot2002,项目名称:VisioAutomation2.0,代码行数:7,代码来源:PieSlice.cs

示例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);
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:7,代码来源:WindowMethods.cs

示例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;
     }
 }
开发者ID:h3tch,项目名称:ProtoFX,代码行数:26,代码来源:TabStyleDefaultProvider.cs

示例7: DrawLine

				public DrawLine(Drawing drawing, Window window)
				{
					this.drawing = drawing;
					this.window = window;
					testName = AssemblyExtensions.GetTestNameOrProjectName();
					material = new Material(ShaderFlags.Position2DColored, "");
				}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:DrawingTests.cs

示例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);
 }
开发者ID:ondrej11,项目名称:o106,代码行数:7,代码来源:PointByCoordinates.cs

示例9: OpenTKImage

 public OpenTKImage(string filename, Drawing drawing)
     : base(filename, drawing)
 {
     InitializeTextureHandle();
     TryLoadBitmapFile("Content/" + filename + ".png");
     SetSamplerState();
 }
开发者ID:hillwhite,项目名称:DeltaEngine,代码行数:7,代码来源:OpenTKImage.cs

示例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);
      }

    }
开发者ID:flq,项目名称:Rf.Lotto,代码行数:26,代码来源:MostPopularNumsPerYear.cs

示例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");
        }
开发者ID:eric7237cire,项目名称:CodeJam,代码行数:29,代码来源:ShowProjections.cs

示例12: WriteToDrawingsStandartsRates

        public void WriteToDrawingsStandartsRates(Drawing drawing)
        {
            var finded =
                GetListCollection().FirstOrDefault(x => x.Equals(drawing));

            WriteToDrawingsStandartsRates(drawing, finded);
        }
开发者ID:ctukc-nt,项目名称:UPPY_v2,代码行数:7,代码来源:DrawingStandartezer.cs

示例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 );
        }
开发者ID:CecleCW,项目名称:ProductMan,代码行数:26,代码来源:SuperToolTipManager.cs

示例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);
         }
     }
 }
开发者ID:prepare,项目名称:HTML-Renderer,代码行数:29,代码来源:4_ImgSpanGenGray.cs

示例15: DwgEditor

 public DwgEditor(Drawing dwg)
 {
     Dwg = dwg;
     Mode = EDwgMode.Line;
     ClipToBounds = true;
     Focusable = true;
 }
开发者ID:keshavb-96,项目名称:CAD,代码行数:7,代码来源:DwgEditor.cs


注:本文中的Drawing类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。