Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to redraw picturebox's image in a thread in 50 msec intervals.
When I clear the picturebox before redrawing, it flickers.
And when I don't clear, the old image also remains!
(In fact I have two pictures overlaying (pictures background is transparent) and I want to rotate second image by angle on the first one).
My aim is to create a radar screen like real radar.
I saw a project here but I wanted to do my own.

Could you pls tell me what to do??
Should I use another control? Which one?

Thanks.

What I have tried:

Picturebox, Panel Control,
Graphics.Clear(), Panel.Invalidate(), Panel.Refresh(),
Posted
Updated 2-Jan-17 0:07am

You can use
Control.DoubleBuffered
to reduce the flickering..

for more info :-
Control.DoubleBuffered Property (System.Windows.Forms)[^]
 
Share this answer
 
I can imagine that DoubleBuffered doesn't solve your Problem.
What you can do is : only repaint / refresh those area where the rotating Picture was before and also the area where it is now.
 
Share this answer
 
Comments
jamshid_m 2-Jan-17 11:23am    
There is not such component in .NET that can show or draw image effectively!?
I have tried refreshing panel. I can't repaint rotating picture old area.
Ralf Meier 2-Jan-17 12:33pm    
No ... you should develop your own customized control which has the Behaviour you want to have.
But I thought, that you still have developed something like this and you are stucking at a special point.
Are you familiar with controls-development ...?
jamshid_m 4-Jan-17 11:42am    
Hi Ralf Meier,
Thanks for your reply.
Right now I'm learning WPF, I saw somewhere that in WPF I can do it.
Am I right?
Ralf Meier 5-Jan-17 5:57am    
I don't know because I mostly work with Windows-Forms.
But ... I don't think, that a Standard-Control will help you ... I think, the only way is to build your own Control which does exactly what you want.
If else the Suggestion from Solution 1 would solve your Problem - I think it doesn't do ...

What do you want to do now ?
jamshid_m 5-Jan-17 7:25am    
I don't know much about WPF.
I read that working with pictures is easy in WPF. Therefore I want to do my job in WPF and call it in Windows-Form.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900