Recent

Author Topic: After drawing Shapes on a canvas How can one clear the canvas.  (Read 2091 times)

DenPit5

  • New Member
  • *
  • Posts: 21
After drawing Shapes on a canvas How can one clear the canvas.
« on: December 16, 2018, 04:46:11 pm »
I have tried 'Canvas.clear' but that is thrown out as an error.   I have searched all the documentation I know of but have not yet found an answer.  Can anyone Help ?

Handoko

  • Hero Member
  • *****
  • Posts: 5130
  • My goal: build my own game engine using Lazarus
Re: After drawing Shapes on a canvas How can one clear the canvas.
« Reply #1 on: December 16, 2018, 05:04:19 pm »
Please show us the code. Preferably the whole source code.

Create a new folder, copy all the necessary files into the folder except: the binary (exe file), *.bak, lib and backup folders. Compress the folder and send the zip here.

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: After drawing Shapes on a canvas How can one clear the canvas.
« Reply #2 on: December 16, 2018, 05:19:51 pm »
FillRect the size of the control with the background color?

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: After drawing Shapes on a canvas How can one clear the canvas.
« Reply #3 on: December 16, 2018, 07:31:13 pm »
Although I've never used the CLEAR method of the canvas, it does work for me on 1.8.4 Windersssss

The only true wisdom is knowing you know nothing

DenPit5

  • New Member
  • *
  • Posts: 21
Re: After drawing Shapes on a canvas How can one clear the canvas.
« Reply #4 on: December 17, 2018, 06:36:16 pm »
Many thanks to all who answered with suggestions.  I have since found the answer after doing one or two possible commands trying different words I then tried 'repaint' and lo and behold it worked. !!!

 

TinyPortal © 2005-2018