Board index » delphi » Keeping canvas image after dragover??

Keeping canvas image after dragover??

Hi,
  does anybody know what to do, so that when one drags a form over a canvas
that contains an image/lines etc, the image/line etc. reapears or stays
there as soon as the canvas becomes visible again.

Hope you understand my problem.
Thanx in advance

Karl Khn

 

Re:Keeping canvas image after dragover??


Quote
Khn wrote:

> Hi,
>   does anybody know what to do, so that when one drags a form over a canvas
> that contains an image/lines etc, the image/line etc. reapears or stays
> there as soon as the canvas becomes visible again.

> Hope you understand my problem.

       Draw all those image/line etc in the form's OnPaint event handler -
this gets called automatically when the form needs to be repainted.

--
David Ullrich

sig.txt not found

Re:Keeping canvas image after dragover??


Thanx for the reply,
however the canvas I was talking about was not from a form but from a Chart
which does not have an OnPaint event handler-
You might ask me why I am drawing in the Chart's Canvas, well the point's I
have to plot have to be at real time, and the Chart just takes much to long,
I am looking at times from 0.2 sec.
Any suggestions??
Karl Khn
Quote
David wrote:
>       Draw all those image/line etc in the form's OnPaint event handler -
>this gets called automatically when the form needs to be repainted.

Re:Keeping canvas image after dragover??


Quote
Khn wrote:

> Thanx for the reply,
> however the canvas I was talking about was not from a form but from a Chart
> which does not have an OnPaint event handler-
> You might ask me why I am drawing in the Chart's Canvas, well the point's I
> have to plot have to be at real time, and the Chart just takes much to long,
> I am looking at times from 0.2 sec.
> Any suggestions??
> Karl Khn

      Well, I never used one of those chart things. Assuming you're talking about
the TChart that ships with D3, there are a few things that seem like they
might work that I see on a quick pass through the docs:

(i) Have you tried using the Chart instead of doing the drawing yourself,
    setting BufferedDisplay:= True? (And if that doesn't help have you
    tried setting BufferedDisplay:= False<g>???)

(ii) Some canvases "remember" what you draw on them. I gather TChart's
    canvas doesn't. If a _component_ exposes a non-persistent Canvas
    property it simply _must_ also have an event that you use the way
    you use the OnPaint event, otherwise you simply can't get the
    canvas to work right. So I looked at the docs... have you tried
    doing all your drawing in the chart's OnAfterDraw event?

      If OnAfterDraw does what I suspect you'd better not do anything
    there that modifies the chart itself - you just draw things on
    the canvas there. (???) Probably the canvas to draw on is
    (Sender as TChart).Canvas.

--
David Ullrich

sig.txt not found

Other Threads