Method function IGDIPlus.IGPGraphics.DrawBezierF(IGPPen;Single;Single;Single;Single;Single;Single;Single;Single) : TGPGraphics

From Mitov Wiki Doc
(Difference between revisions)
Jump to: navigation, search
David Alm (Talk | contribs)
(Automated Syncronization with Documentation)

Latest revision as of 17:19, 18 October 2012

This is a Beta Read Only version of this page. Please review and send recommendations to mitov@mitov.com. We will enable the editing as soon as we are happy with the overall Wiki site.

Class: IGPGraphics

Contents

Syntax

Delphi:

function DrawBezierF( pen : IGPPen, x1 : Single, y1 : Single, x2 : Single, y2 : Single, x3 : Single, y3 : Single, x4 : Single, y4 : Single ) : TGPGraphics;

C++ Builder:

TGPGraphics __fastcall DrawBezierF( IGPPen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4 );

Visual C++ (MFC):

DrawBezierF(  pen,  x1,  y1,  x2,  y2,  x3,  y3,  x4,  y4 );

Summary

Draws a Bézier spline.

Description

Call this method to draw a Bézier spline.


Example:

The following example draws a Bézier curve.

var
  AGraphics  : IGPGraphics;
  APath      : IGPGraphicsPath;
  ARedBrush  : IGSolidBrush;
  ABlueBrush : IGSolidBrush;

begin
  AGraphics := TGPGraphics.Create( ACanvas );

  // Set up the pen and curve points.
  Pen greenPen(Color(255, 0, 255, 0));

   //Draw the curve.
  AGraphics.DrawBezierF( TGLPen.Create( aclGreen ), 100.0, 100.0, 200.0, 10.0, 350.0, 50.0, 500.0, 100.0 );

   //Draw the end points and control points.
  ARedBrush := TGSolidBrush.Create( aclRed );
  ABlueBrush := TGSolidBrush.Create( aclBlue );

  AGraphics.FillEllipse(ARedBrush, 100 - 5, 100 - 5, 10, 10);
  AGraphics.FillEllipse(ARedBrush, 500 - 5, 100 - 5, 10, 10);
  AGraphics.FillEllipse(ABlueBrush, 200 - 5, 10 - 5, 10, 10);
  AGraphics.FillEllipse(ABlueBrush, 350 - 5, 50 - 5, 10, 10);

Remarks A Bézier spline does not pass through its control points. The control points act as magnets, pulling the curve in certain directions to influence the way the Bézier spline bends.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox