N
news.austin.rr.com
Hi,
I'am writing a graphing custom control in C# .NET CF. I have a rectangle for
the client area which includes an area at the bottom of the graph for
displaying a value on the far left and another value on the far right. I
have another rectangle that is the graph client area. The code below creates
the 2 rectangles.
Rectangle rcClient = this.ClientRectangle;
Rectangle rcGraphClient = new Rectangle(rcClient.X, rcClient.Y,
rcClient.Width, rcClient.Height - 20);
as you can see the second rectangle leaves room for my values to be
displayed on the bottom left and bottom right.
I also use double buffering and draw to a bitmap offscreen.
However, if i only invalidate the rcGraphClient I still get flicker on the
screen. The graph trace is being drawn very fast using a single call to the
drawpolygon method.
The question is this...
should i let my paint routine always draw everything and only invalidate the
rectangles im updating?
Are there any good resources (books) that go into detail on creating high
quality custom controls that are complex like a graphing control?
I just want to know the standard practice on invalidating rectangles and
handling the logic for the onpaint event.
Thanks
I'am writing a graphing custom control in C# .NET CF. I have a rectangle for
the client area which includes an area at the bottom of the graph for
displaying a value on the far left and another value on the far right. I
have another rectangle that is the graph client area. The code below creates
the 2 rectangles.
Rectangle rcClient = this.ClientRectangle;
Rectangle rcGraphClient = new Rectangle(rcClient.X, rcClient.Y,
rcClient.Width, rcClient.Height - 20);
as you can see the second rectangle leaves room for my values to be
displayed on the bottom left and bottom right.
I also use double buffering and draw to a bitmap offscreen.
However, if i only invalidate the rcGraphClient I still get flicker on the
screen. The graph trace is being drawn very fast using a single call to the
drawpolygon method.
The question is this...
should i let my paint routine always draw everything and only invalidate the
rectangles im updating?
Are there any good resources (books) that go into detail on creating high
quality custom controls that are complex like a graphing control?
I just want to know the standard practice on invalidating rectangles and
handling the logic for the onpaint event.
Thanks