edivando-fpc / BGRABitmap

BGRABitmap and BGRAControls for Lazarus and Delphi
Other
16 stars 12 forks source link

Solves bug drawing rectangles and dashed lines. #2

Open DomingoGP opened 5 years ago

DomingoGP commented 5 years ago

Hi,

when testing this sample code taken from tutorial, draws a a figure like a triangle. and a shape like a triangle instead of a dotted line.

This patch solves both problems.

procedure TForm1.Button1Click(Sender: TObject); var image: TBGRABitmap; c: TBGRAPixel; begin image := TBGRABitmap.Create(ClientWidth,ClientHeight,ColorToBGRA(ColorToRGB(clBtnFace))); c := ColorToBGRA(ColorToRGB(clWindowText)); image.RectangleAntialias(80,80,300,200,c,10); image.PenStyle := psDot; image.DrawLineAntialias(20,300,150,300,c,10,true); image.Draw(Canvas,0,0,True); image.free; end;