Recent

Author Topic: Canvas Autodraw doesn't work  (Read 2166 times)

TRon

  • Hero Member
  • *****
  • Posts: 3787
Re: Canvas Autodraw doesn't work
« Reply #15 on: March 06, 2024, 11:01:31 pm »
The problem is I can't use OnPaint (Image1Paint) to draw. because it is useful only during coding.
That 'problem' was already addressed in the previous posts.

But let make it more practical for you.... besides your image (Timage), create a new variable TheBitmapWhereIPaintTo of type TBitmap, create it on form creation, destroy it on form destruction and blit it to the image in the onpaint event. Now take a guess where you will actually be drawing to when you move and click your mouse  :)

I do have to apologize for the link to the Delphi article. It might perhaps have worked that way in the olden days but not anymore (though the other logic used in the example still applies).

A better example might perhaps be here (but it uses a TPaintBox instead of a TImage).

edit: scribble example from the same website that can perhaps be reproduced more easily.
« Last Edit: March 06, 2024, 11:51:59 pm by TRon »
I do not have to remember anything anymore thanks to total-recall.

 

TinyPortal © 2005-2018