Click here to Skip to main content
15,910,981 members
Home / Discussions / C#
   

C#

 
GeneralRe: Data Adapter passing by reference to stored procedure Pin
Josh Smith21-Jun-06 10:44
Josh Smith21-Jun-06 10:44 
QuestionPaint Event Handler Pin
ZeAugusto21-Jun-06 7:23
ZeAugusto21-Jun-06 7:23 
AnswerRe: Paint Event Handler Pin
Josh Smith21-Jun-06 7:25
Josh Smith21-Jun-06 7:25 
GeneralRe: Paint Event Handler Pin
ZeAugusto21-Jun-06 7:42
ZeAugusto21-Jun-06 7:42 
GeneralRe: Paint Event Handler [modified] Pin
led mike21-Jun-06 8:01
led mike21-Jun-06 8:01 
GeneralRe: Paint Event Handler Pin
Josh Smith21-Jun-06 8:06
Josh Smith21-Jun-06 8:06 
GeneralRe: Paint Event Handler Pin
Jun Du21-Jun-06 9:05
Jun Du21-Jun-06 9:05 
GeneralRe: Paint Event Handler Pin
ZeAugusto21-Jun-06 12:05
ZeAugusto21-Jun-06 12:05 
Thanks for all the replies!

As I didn't know how to add content without refreshing the whole object, I ended up implementing a mixture of your suggestion with Josh's and Led's ones. I used the GraphicsPath class instead of just drawing single line segments, adding the newly calculated points to it, and then redrew the entire path at every Refresh() call (which happens whenever I add a point to the graph, every 40 ms). At the end of the line, I clone this path to a second one, and reset the first. This way, I work with two paths, the most recent one "above" the oldest, and redraw both when a new point is added.

To solve that "erasing" part I mentioned before, I used a little trick. I draw a black rectangle (because the background of the graph region is also black) between the two paths, and resize it so that it is always a few pixels wider than the top path. This way, it looks like there is an eraser in front of the line being drawn. It's quite similar to what I've already done in Flash.

But I have a new question, though. As far as I draw all these objects every 40 miliseconds, I wonder if I might experience some performance issues. The application is intended to support an average of 5 to 10 simutaneous instances of this control, so that might become a problem... Or am I just being paranoid because of my Flash experience?


Thanks,
Ze
GeneralRe: Paint Event Handler Pin
Jun Du22-Jun-06 4:27
Jun Du22-Jun-06 4:27 
AnswerRe: Paint Event Handler Pin
led mike21-Jun-06 7:28
led mike21-Jun-06 7:28 
QuestionOpacity Control Pin
Cubzfan21-Jun-06 6:57
Cubzfan21-Jun-06 6:57 
AnswerRe: Opacity Control Pin
led mike21-Jun-06 7:27
led mike21-Jun-06 7:27 
GeneralRe: Opacity Control Pin
Cubzfan21-Jun-06 7:32
Cubzfan21-Jun-06 7:32 
GeneralRe: Opacity Control Pin
led mike21-Jun-06 7:41
led mike21-Jun-06 7:41 
GeneralRe: Opacity Control Pin
Cubzfan21-Jun-06 7:51
Cubzfan21-Jun-06 7:51 
GeneralRe: Opacity Control Pin
led mike21-Jun-06 7:59
led mike21-Jun-06 7:59 
GeneralRe: Opacity Control Pin
Cubzfan21-Jun-06 8:07
Cubzfan21-Jun-06 8:07 
GeneralRe: Opacity Control Pin
led mike21-Jun-06 9:29
led mike21-Jun-06 9:29 
QuestionRe: Opacity Control Pin
Dustin Metzgar21-Jun-06 8:33
Dustin Metzgar21-Jun-06 8:33 
AnswerRe: Opacity Control Pin
Cubzfan21-Jun-06 9:31
Cubzfan21-Jun-06 9:31 
GeneralRe: Opacity Control Pin
Dustin Metzgar21-Jun-06 10:04
Dustin Metzgar21-Jun-06 10:04 
GeneralRe: Opacity Control Pin
Cubzfan21-Jun-06 10:10
Cubzfan21-Jun-06 10:10 
GeneralRe: Opacity Control Pin
Alexander Wiseman21-Jun-06 11:59
Alexander Wiseman21-Jun-06 11:59 
GeneralRe: Opacity Control Pin
Cubzfan21-Jun-06 12:17
Cubzfan21-Jun-06 12:17 
GeneralRe: Opacity Control Pin
Alexander Wiseman21-Jun-06 13:11
Alexander Wiseman21-Jun-06 13:11 

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.