Click here to Skip to main content
15,913,115 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionRe: Invoking a Web Service using Visual C++ .NET Pin
Mark Salsbery8-Jan-09 5:05
Mark Salsbery8-Jan-09 5:05 
AnswerCP: Ignore cross post Pin
EliottA8-Jan-09 6:48
EliottA8-Jan-09 6:48 
AnswerRe: Invoking a Web Service using Visual C++ .NET OR Managed C++ Pin
Thomas_Mathews8-Jan-09 18:17
Thomas_Mathews8-Jan-09 18:17 
QuestionTrouble using namespace System Pin
linkfitz7-Jan-09 5:32
linkfitz7-Jan-09 5:32 
AnswerRe: Trouble using namespace System Pin
Mark Salsbery7-Jan-09 7:50
Mark Salsbery7-Jan-09 7:50 
Questionflicker free drawing [modified] Pin
staticv6-Jan-09 3:13
staticv6-Jan-09 3:13 
AnswerRe: flicker free drawing Pin
Mark Salsbery6-Jan-09 5:48
Mark Salsbery6-Jan-09 5:48 
GeneralRe: flicker free drawing [modified] Pin
Luc Pattyn6-Jan-09 6:34
sitebuilderLuc Pattyn6-Jan-09 6:34 
Hi,

I concur with Mark, multithreading typically will not help.

Most of the flickering is due to the fact that things get erased (or background painted) before the foreground gets painted, so your drawing is absent for a while. This is most noticeable when there isn't much calculation going on, i.e. as soon as the painting is done, a new cycle starts with erasure and repaint, erasure being the faster of the two.

Here is what improves the behavior:
- increase the painting performance by optimizing the code; e.g. avoid creating and disposing objects in your Paint method, use the Graphics from PaintEventArgs (don't use CreateGraphics), keep your Fonts, Pens, Brushes in class members, etc.
- only repaint what needs repainting, use the clip rectangle to determine whether each part of your drawing needs a repaint before painting it;
- set your Form, Panel, or whatever Container is relevant to DoubleBuffered; when
double-buffered the container does not erase, it just overpaints what is already in place.
- possibly, depends on your needs: limit the repaint frequency; rather than repaint (i.e. call invalidate) for every mouse movement, maybe set up a Forms.Timer to repaint at a fixed frequency of say 10Hz.

FWIW: when you need to track mouse movements (say some rubber banding stuff) there is a ControlPaint class that supports this, however it is not very easy to use it correctly since it can paint outside your container, so when another Form overlaps your container it could disrupt that Form's content.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Love, happiness and fewer bugs for 2009!


modified on Tuesday, January 6, 2009 12:40 PM

QuestionASyncCallback argument not available in the BeginInvoke method in Managed C++ Pin
gurindersm2-Jan-09 1:42
gurindersm2-Jan-09 1:42 
QuestionRe: ASyncCallback argument not available in the BeginInvoke method in Managed C++ Pin
Mark Salsbery2-Jan-09 6:49
Mark Salsbery2-Jan-09 6:49 
AnswerRe: ASyncCallback argument not available in the BeginInvoke method in Managed C++ Pin
gurindersm5-Jan-09 1:33
gurindersm5-Jan-09 1:33 
GeneralRe: ASyncCallback argument not available in the BeginInvoke method in Managed C++ Pin
Mark Salsbery5-Jan-09 6:46
Mark Salsbery5-Jan-09 6:46 
GeneralRe: ASyncCallback argument not available in the BeginInvoke method in Managed C++ Pin
gurindersm5-Jan-09 21:23
gurindersm5-Jan-09 21:23 
GeneralRe: ASyncCallback argument not available in the BeginInvoke method in Managed C++ Pin
N a v a n e e t h5-Jan-09 21:39
N a v a n e e t h5-Jan-09 21:39 
GeneralRe: ASyncCallback argument not available in the BeginInvoke method in Managed C++ Pin
gurindersm6-Jan-09 1:40
gurindersm6-Jan-09 1:40 
GeneralRe: ASyncCallback argument not available in the BeginInvoke method in Managed C++ Pin
Mark Salsbery6-Jan-09 5:09
Mark Salsbery6-Jan-09 5:09 
Questionpassing info from one application to another Pin
debonair12345629-Dec-08 0:58
debonair12345629-Dec-08 0:58 
AnswerRe: passing info from one application to another Pin
N a v a n e e t h29-Dec-08 2:09
N a v a n e e t h29-Dec-08 2:09 
Questionpassing a data to another application with c++. Pin
debonair12345624-Dec-08 21:57
debonair12345624-Dec-08 21:57 
AnswerRe: passing a data to another application with c++. Pin
Giorgi Dalakishvili24-Dec-08 23:22
mentorGiorgi Dalakishvili24-Dec-08 23:22 
QuestionHow to pass reference in constructor? Pin
randomVariable24-Dec-08 1:40
randomVariable24-Dec-08 1:40 
AnswerRe: How to pass reference in constructor? Pin
N a v a n e e t h24-Dec-08 2:25
N a v a n e e t h24-Dec-08 2:25 
GeneralRe: How to pass reference in constructor? [modified] Pin
randomVariable24-Dec-08 6:31
randomVariable24-Dec-08 6:31 
GeneralRe: How to pass reference in constructor? Pin
Mark Salsbery25-Dec-08 7:48
Mark Salsbery25-Dec-08 7:48 
Question32 bit color depth bitmap problem with XP Pin
fire storm21-Dec-08 23:44
fire storm21-Dec-08 23:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.