own component - painting-problem

From: Dirk Hennings (dhennings_at_gmx.de)
Date: 03/27/04


Date: Sat, 27 Mar 2004 23:24:51 +0100

Hi,

I derived my component from TPanel.
The only thing I "really" do is override the paint-method:

procedure TMyPanel.Paint;
begin
inherited;
bitblt(canvas.handle, 0,0, width, height, background.bitmap.canvas.handle,
0,0, SRCCOPY)
end;

I have no idea what inherited changes?
Is this needed?
A friend told me that a call to BeginPaint should be made so that the
paint-procedure isn't recursively called.
Is this true?

The main problem is that while resizing the application flickers a lot.
It seems that the Panel paints itself with its color first.
After that the picture is copied on the canvas.

I'm not really sure if this is the case, because:
I tried this on 3 other computers and no flickering at all.
My graphic-card seems to have a strange driver though (or because?) it's a
Matrox G450.
Many applications are running slowly on my computer, but if I see something
like the flickering I get suspicious!
Is it possible that my driver is buggy and I my component is totally ok?
Since the background is painted first and my background-image is copied
afterwards I thought that my component is buggy and the operation is so
simple, so that I just can't see the "bad effect" on other computers.
Does anybody know if this can be the case?
I'm not familiar with the painting of component and the integration of the
driver.
Maybe this could be the driver's fault, maybe not.

I would really appriciate any piece of information on that since I'm really
confused.
Thanks a lot

Dirk


Quantcast