Talk:FMXTCanvasFillFunctions (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

The example make use of BitmapChanged which is no more available. The code should be updated. See http://blogs.embarcadero.com/davidi/2013/02/15/42568



the code like this //--------------------------------------- procedure TForm1.Button1Click(Sender: TObject); var

 p1, p2: TPointF;

begin

 Image1.Bitmap.Canvas.Fill.Color :=TAlphaColors.Black;
 // Sets the center of the arc
 p1.Create(200, 200);
 // sets the radius of the arc
 p2.Create(150, 150);
 // fills and draws the arc on the canvas
 Image1.Bitmap.Canvas.FillArc(p1, p2, 90, 230, 20);
 // updates the bitmap
 Image1.Bitmap.BitmapChanged;

end;

procedure TForm1.FormCreate(Sender: TObject); begin

 Image1.Bitmap.Create(400, 400);
 Image1.Bitmap.Clear(TAlphaColors.White);

end; //--------------------------------------- but when button1 Clicked, the Image1 nothing to happened.


Thank you for the input! We will analyze your suggestion as soon as possible. -- Denisa Ilascu

-->>

Button1 has the following implementation of its OnClick event:

procedure TForm1.Button1Click(Sender: TObject);
begin
  // clears the canvas
  Image1.Bitmap.Canvas.Clear(clawhite);
  Image1.Bitmap.BitmapChanged;
end;

This implementation clears the image of the previous drawings issued by the RadioButtons.

Your implementation of Button1 is the same as the example's RadioButton11 but with an additional color select line. And this works quite as expected. Changes the color to black, then renders what the first RadioButton should render.

--AG