WinAPI: PolyBezierTo - 绘制贝塞尔线(更新当前位置)


//声明:

PolyBezierTo(

  DC: HDC;      {设备环境句柄}

  const Points; {点数组}

  Count: DWORD  {数组元素个数}

): BOOL;


 
   
//需要给 PolyBezierTo 指定起始点 procedure TForm1.FormPaint(Sender: TObject); var ps: array[0..2] of TPoint; begin ps[0].X := 40; ps[0].Y := 110; ps[1].X := 80; ps[1].Y := 30; ps[2].X := 110; ps[2].Y := 70; MoveToEx(Canvas.Handle, 10,70, nil); PolyBezierTo(Canvas.Handle, ps, 3); end;
//效果图:
WinAPI: PolyBezierTo - 绘制贝塞尔线(更新当前位置)

//PolyBezierTo 会更新当前位置

procedure TForm1.FormPaint(Sender: TObject);

var

  ps: array[0..2] of TPoint;

begin

  ps[0].X := 40;

  ps[0].Y := 110;

  ps[1].X := 80;

  ps[1].Y := 30;

  ps[2].X := 110;

  ps[2].Y := 70;

 

  MoveToEx(Canvas.Handle, 10,70, nil);

  PolyBezierTo(Canvas.Handle, ps, 3);



  {PolyBezierTo 已更新当前位置, 继续画}

  LineTo(Canvas.Handle, 110,10);

  LineTo(Canvas.Handle, 10,10);

  LineTo(Canvas.Handle, 10,70);

end;


 
   
//效果图:
WinAPI: PolyBezierTo - 绘制贝塞尔线(更新当前位置)

你可能感兴趣的:(api)