How should I paint text on canvas so that the text won’t disappear after repaint/update/refresh without repainting it again and again? Like it was painted as image and not temporarily painted.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are talking about, for example, a
TPaintBoxcontrol or something similar, then there is no persistent canvas to paint on. The system simply is not designed that way and the VCL controls reflect the underlying Windows framework.The normal approach is as follows:
There are a variety of reasons that may lead you to this approach. Often performance is a factor. It may be expensive to paint and caching the image can help. Sometimes the information required in order to paint may be transient and again caching the output may be a solution.