GDI+ drawing have flicker/ slow down, need solution

Apr 12 2010 6:11 AM
Hi, I am trying to scroll text from bottom to up by using GDI+ graphics object.
my code is

 Bitmap bmp = new Bitmap(1024, 768);
 Graphics gr = Graphics.FromImage((Image)bmp);
for (int count = 768; count >= -0; count--)
{
             gr.Clear(promptTextBackColor);
             gr.DrawString(richEditor.Text, font, new SolidBrush(ForeColor), 10, count);

This gives too much jurk , then i used one following line of code

scrollForm.CreateGraphics().DrawImageUnscaled(bmp, 0, 0);
 
here scrollform is windows form on which i have to show scrolling.

now no jurk but it is very very slow, not acceptable by client.

can anyone know how to do it fast and more effective.
Please help.


Answers (1)