int DrawPolyFill(int dr, int *points);

 

Draws a filled polygon on the specified Draw surface.

 

Return Value

 

Return value not used.

 

Parameters

 

dr

The handle to the Draw surface where the square will be drawn.

 

points

Pointer to an array of points that defines the polygon.

 

Remarks

 

DrawPolyFill() will draw a polygon using the coordinates specified in the array pointed to by points.  Specify the color of the polygon using DrawSetFillColor().

 

Availability

 

Available in DragonFireSDK 1.3.1 and later.

 

Example

 

// This program demonstrates how to draw non-regular

// polygons on a Draw surface with DragonFireSDK.

 

#include "DragonFireSDK.h"

 

// Define a polygon as an array of points.

// The last point, -1, -1 tells the drawing

// system where the end of the array is.

int MyWeirdShape[] =

{

  5, 10,

  30, 10,

  45, 89,

  7, 100,

  -1, -1

};

 

// Handle for the Draw surface.

int MyDraw;

// Delta for modifying the polygon.

int Delta = 1;

 

void DrawPolygons()

{

  // Clear the Draw surface.

  DrawClear(MyDraw);

  // Set the pen width so we can see it clearly.

  DrawSetPenWidth(MyDraw, 3);

  // Set the draw (pen) color to blue.  Colors are expressed as RRGGBB.

  DrawSetColor(MyDraw, 0x0000FF);

  // Set the draw (fill) color to green.  Colors are expressed as RRGGBB.

  DrawSetFillColor(MyDraw, 0x00FF00);

  // Draw the filled shape.

  DrawPolyFill(MyDraw, MyWeirdShape);

  // Draw the hollow shape.

  DrawPoly(MyDraw, MyWeirdShape);

}

 

void AppMain()

{

  // Create a Draw surface.

  MyDraw = DrawAdd(0, 0, 200, 200);

  // Draw the polygons for the first time.

  DrawPolygons();

}

 

void OnTimer()

{

  // Check to see that the first x coordinate for MyWeirdShape is within

  // certain limits and modify the Delta value accordingly.

  if (MyWeirdShape[0] >= 19)

  {

     Delta = -1;

  }

  else if (MyWeirdShape[0] <= 5)

  {

     Delta = 1;

  }

  // Apply the Delta.

  MyWeirdShape[0] += Delta;

  MyWeirdShape[1] += Delta;

  // Redraw our polygons.

  DrawPolygons();

}

 

void AppExit()

{

}