DrawPolygon Method

Summary
Draws the outline of a polygon using an array of Point structures and the specified D2DPen.
Syntax
C#
C++
public void DrawPolygon( 
   D2DPen pen, 
   Point[] points 
) 
vb[VB Syntax] 
  
Public Sub DrawPolygon( _ 
   ByVal _pen_ As D2DPen, _ 
   ByVal _points_() As Point _ 
) 
public: 
void DrawPolygon(  
   D2DPen^ pen, 
   array<Point>^ points 
)  

Parameters

pen
D2DPen that determines the Pen brush, thickness, and style.

points
Array of Point structures that represent the vertices of the polygon.

Remarks

This method draws the outline of the specified polygon using the specified Pen style.

Example
C#
using Leadtools.Windows.D2DRendering; 
 
public void D2DSurfaceExample() 
{ 
   //Create a new instance of the D2DSurface object 
   D2DSurface d2dSurface = new D2DSurface(); 
 
   //Set the surface Size 
   d2dSurface.SurfaceSize = new Size(1000, 1000); 
 
   //Pass an empty rect to redraw the entire surface 
   d2dSurface.BeginDraw(Rect.Empty); 
 
   //Save the surface drawing state 
   D2DDrawingState drawingState = d2dSurface.Save(); 
 
   //Create a rect having the specified dimensions 
   Rect rect = new Rect(40, 40, 500, 200); 
 
   //Create a new instance of a brush from a new solid color brush 
   Brush fill = new SolidColorBrush(Colors.Green); 
 
   //Fill the interior of the specified rectangle using the specified brush 
   d2dSurface.FillRectangle(fill, rect); 
 
   //Create a new instance of the D2DPen object 
   D2DPen pen = new D2DPen(new SolidColorBrush(Colors.Red), 2); 
 
   //Draw an outline using the specified rectangle and D2DPen 
   d2dSurface.DrawRectangle(pen, rect); 
 
   //Restore the surface drawing state 
   d2dSurface.Restore(drawingState); 
 
   //End the Draw operation and invalidate the surface 
   d2dSurface.EndDraw(); 
 
   d2dSurface.Invalidate(Rect.Empty); 
} 
Requirements

Target Platforms

Help Version 22.0.2022.4.4
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2022 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Windows.D2DRendering Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2022 LEAD Technologies, Inc. All Rights Reserved.