Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
AnswerRe: Is it impossible to achive really smooth scrolling horizontal text? Pin
Eduard Keilholz28-Oct-08 3:54
Eduard Keilholz28-Oct-08 3:54 
GeneralRe: Is it impossible to achive really smooth scrolling horizontal text? Pin
KD19742-Jun-10 5:03
KD19742-Jun-10 5:03 
GeneralRe: Is it impossible to achive really smooth scrolling horizontal text? Pin
KD19749-Jun-10 1:31
KD19749-Jun-10 1:31 
AnswerRe: Is it impossible to achive really smooth scrolling horizontal text? Pin
Mark Churchill28-Oct-08 14:03
Mark Churchill28-Oct-08 14:03 
GeneralRe: Is it impossible to achive really smooth scrolling horizontal text? Pin
stianstr28-Oct-08 22:02
stianstr28-Oct-08 22:02 
GeneralRe: Is it impossible to achive really smooth scrolling horizontal text? Pin
Mark Churchill29-Oct-08 0:49
Mark Churchill29-Oct-08 0:49 
GeneralRe: Is it impossible to achive really smooth scrolling horizontal text? Pin
stianstr29-Oct-08 1:32
stianstr29-Oct-08 1:32 
GeneralRe: Is it impossible to achive really smooth scrolling horizontal text? Pin
Mark Churchill29-Oct-08 2:39
Mark Churchill29-Oct-08 2:39 
As I mentioned, you can't sleep a thread for 5ms. If the kernel gives a timeslice to another thread, then it will give a fullquanta, which is around 50ms on XP.

Take the simple example:
<br />
        private void Form1_Load(object sender, EventArgs e)<br />
        {<br />
            startTime = DateTime.Now;<br />
            g = Graphics.FromImage(bmp);<br />
            g.Clear(Color.White);<br />
            this.Invalidate();<br />
        }<br />
<br />
        protected override void OnPaint(PaintEventArgs e)<br />
        {<br />
            position = (float) (((DateTime.Now - startTime).TotalSeconds * 100f) % 800f) - 300f;<br />
            Draw();<br />
            this.Invalidate();<br />
        }


This runs smooth as hell. You don't need to play with fancy timers to get smooth animation. The reason Entanglar uses a rather complicated phase-locked-loop setup is to minimise drift over a long time (which is fairly critical for stable multiplayer).


Questionout Pin
arkiboys28-Oct-08 3:05
arkiboys28-Oct-08 3:05 
AnswerRe: out Pin
Pete O'Hanlon28-Oct-08 3:10
mvePete O'Hanlon28-Oct-08 3:10 
GeneralRe: out Pin
arkiboys28-Oct-08 3:12
arkiboys28-Oct-08 3:12 
GeneralRe: out Pin
Pete O'Hanlon28-Oct-08 3:23
mvePete O'Hanlon28-Oct-08 3:23 
GeneralRe: out Pin
arkiboys28-Oct-08 3:30
arkiboys28-Oct-08 3:30 
GeneralRe: out Pin
Guffa28-Oct-08 4:12
Guffa28-Oct-08 4:12 
GeneralRe: out Pin
arkiboys29-Oct-08 0:30
arkiboys29-Oct-08 0:30 
QuestionPersonal Opinion Pin
EliottA28-Oct-08 2:43
EliottA28-Oct-08 2:43 
AnswerRe: Personal Opinion Pin
#realJSOP28-Oct-08 2:48
professional#realJSOP28-Oct-08 2:48 
GeneralRe: Personal Opinion Pin
EliottA28-Oct-08 3:22
EliottA28-Oct-08 3:22 
AnswerRe: Personal Opinion Pin
PIEBALDconsult28-Oct-08 11:20
mvePIEBALDconsult28-Oct-08 11:20 
QuestionCalendar Pin
boiDev28-Oct-08 1:56
boiDev28-Oct-08 1:56 
AnswerRe: Calendar Pin
Michael Bookatz28-Oct-08 2:10
Michael Bookatz28-Oct-08 2:10 
AnswerRe: Calendar Pin
#realJSOP28-Oct-08 2:12
professional#realJSOP28-Oct-08 2:12 
GeneralRe: Calendar Pin
Michael Bookatz28-Oct-08 2:14
Michael Bookatz28-Oct-08 2:14 
GeneralRe: Calendar Pin
#realJSOP28-Oct-08 2:42
professional#realJSOP28-Oct-08 2:42 
GeneralRe: Calendar Pin
Michael Bookatz28-Oct-08 2:45
Michael Bookatz28-Oct-08 2:45 

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.