Hi there:
I'm trying to plot some xy charts using the Canvas of a TImage, changing some pixels color. Does somebody know if it is possible to refresh the image so that I can see the points being plotted one by one?
Sure, you can call Refresh or Repaint. If you refresh it often though, it will flicker. You'll want to double buffer to prevent it in that case. If you double buffer, you must override the Paint method of the Canvas. You'll need to create a new component to do this.
The code below assumes you created a new component TMyNewTImage from TImage and are overriding the Paint method.
void __fastcall TMyNewTImage:aint(void)
{
static Graphics::TBitmap *Buffer = new Graphics::TBitmap();
/* You can put the next two lines elsewhere in code to speed up the painting. Only call them if Width or Height changes */
Buffer->Width = Width;
Buffer->Height = Height;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.