Click here to Skip to main content
15,899,026 members
Home / Discussions / C#
   

C#

 
AnswerRe: DLL import from a (memory-)stream possible? Pin
Pete O'Hanlon28-Oct-08 3:25
mvePete O'Hanlon28-Oct-08 3:25 
GeneralRe: DLL import from a (memory-)stream possible? Pin
arnold_w28-Oct-08 21:59
arnold_w28-Oct-08 21:59 
QuestionIs it impossible to achive really smooth scrolling horizontal text? Pin
stianstr28-Oct-08 3:11
stianstr28-Oct-08 3:11 
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 
Here is the code from my attempt in C# with GDI.

private void timer1_Tick_1(object sender, EventArgs e)
   {

   // Calculate moving distance and new position
   stopWatch.Stop();            
   distance = speed * (float)(stopWatch.Elapsed.TotalMilliseconds);
   position -= distance; if (position < -300.0f) position = 500.0f;
   stopWatch.Reset();
   stopWatch.Start();

   // Draw to memory bitmap
   g.FillRectangle(Brushes.White, 0, 0, bmp.Width, bmp.Height);
   g.DrawString("This is a test... This is a test...", new Font("Arial", 30), Brushes.Black, position, 15.0f);

   // Output to panel1 graphics
   outGfx.DrawImageUnscaled(bmp, 0, 0);            
}


Note1: Using System.Diagnostics Stopwatch which features elapsed time in milliseconds and fractions of a millsecond.
Note2: the speed variable is fixed at 0.1f
Note3: The timer is running at 1 ms interval.
Note4: My memory bitmap (bmp) is 500x100
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 
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 

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.