Recent

Author Topic: BGRABitmap-RoundRect-Different radius for every corner like CSS Border radius  (Read 1719 times)

circular

  • Hero Member
  • *****
  • Posts: 3022
    • Personal webpage
Here is an example of TBGRAPath:
Code: Delphi  [Select]
  1. uses BGRABitmap, BGRAPath;
  2.  
  3. { TForm1 }
  4.  
  5. procedure TForm1.FormPaint(Sender: TObject);
  6. var
  7.   bmp: TBGRABitmap;
  8.   path: TBGRAPath;
  9. begin
  10.   bmp := TBGRABitmap.Create(ClientWidth,ClientHeight,clBtnFace);
  11.   path := TBGRAPath.Create;
  12.   path.moveTo(20,20);
  13.   path.arcTo(100,20, 100,70, 50);
  14.   path.lineTo(100,150);
  15.   path.lineTo(20,150);
  16.   path.closePath;
  17.   path.stroke(bmp, clBlack, 5);
  18.   path.Free;
  19.   bmp.Draw(Canvas,0,0);
  20.   bmp
Conscience is the debugger of the mind