OVH Cloud OVH Cloud

drawing problem

3 réponses
Avatar
x_laurent69
hello all,

i have a problem when i make drawing.

i draw on a panel, in the OnPaint event. The drawing contains lot of
lines, texts, arrows, ...
Also, when i move the mouse over the panel, i draw a large cross under
the mouse pointer to show to the user the position of mouse.

all work properly...but when i move the mouse, i have a bad screen
effect...it seems that all drawing are "flashing"...

with 2 or 3 lines,no problems. But over 500 lines and more, this
effect is very bad.

Have you this problem too ? if no can you give me an sample of drawing
or ( better ) a solution for me ?

3 réponses

Avatar
Pyroa
Hello !

Sorry for my poor english ... I'm french ;)
Try to draw all your drawing into a bitmap
and draw it on the panel.

You can also to add in the constructor of your panel this code :

Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle(ControlStyles.DoubleBuffer, True)

But the last solution must be don"t work, the first solution is the better
for me :)

bye !

"XLaurent" a écrit dans le message de news:

hello all,

i have a problem when i make drawing.

i draw on a panel, in the OnPaint event. The drawing contains lot of
lines, texts, arrows, ...
Also, when i move the mouse over the panel, i draw a large cross under
the mouse pointer to show to the user the position of mouse.

all work properly...but when i move the mouse, i have a bad screen
effect...it seems that all drawing are "flashing"...

with 2 or 3 lines,no problems. But over 500 lines and more, this
effect is very bad.

Have you this problem too ? if no can you give me an sample of drawing
or ( better ) a solution for me ?


Avatar
ACH
Hello,
You can read also precedent question "Pourquoi jamais de réponse ???" for
"DoubleBuffer" solution.


"XLaurent" a écrit :

hello all,

i have a problem when i make drawing.

i draw on a panel, in the OnPaint event. The drawing contains lot of
lines, texts, arrows, ...
Also, when i move the mouse over the panel, i draw a large cross under
the mouse pointer to show to the user the position of mouse.

all work properly...but when i move the mouse, i have a bad screen
effect...it seems that all drawing are "flashing"...

with 2 or 3 lines,no problems. But over 500 lines and more, this
effect is very bad.

Have you this problem too ? if no can you give me an sample of drawing
or ( better ) a solution for me ?



Avatar
Eric Mittelette[MS\)
Good response from pyroa.
In the case that you describe, I think dbl buffering is the good way...

My2Cents
Eric

"Pyroa" <##> a écrit dans le message de news:

Hello !

Sorry for my poor english ... I'm french ;)
Try to draw all your drawing into a bitmap
and draw it on the panel.

You can also to add in the constructor of your panel this code :

Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle(ControlStyles.DoubleBuffer, True)

But the last solution must be don"t work, the first solution is the better
for me :)

bye !

"XLaurent" a écrit dans le message de news:

hello all,

i have a problem when i make drawing.

i draw on a panel, in the OnPaint event. The drawing contains lot of
lines, texts, arrows, ...
Also, when i move the mouse over the panel, i draw a large cross under
the mouse pointer to show to the user the position of mouse.

all work properly...but when i move the mouse, i have a bad screen
effect...it seems that all drawing are "flashing"...

with 2 or 3 lines,no problems. But over 500 lines and more, this
effect is very bad.

Have you this problem too ? if no can you give me an sample of drawing
or ( better ) a solution for me ?