Click here to Skip to main content
15,890,825 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to write to Structured file? Pin
Eddy Vluggen22-Aug-12 8:53
professionalEddy Vluggen22-Aug-12 8:53 
QuestionC# 2010 working with xml Pin
sc steinhayse22-Aug-12 3:57
sc steinhayse22-Aug-12 3:57 
AnswerRe: C# 2010 working with xml Pin
BobJanova22-Aug-12 4:32
BobJanova22-Aug-12 4:32 
GeneralRe: C# 2010 working with xml Pin
sc steinhayse22-Aug-12 5:57
sc steinhayse22-Aug-12 5:57 
GeneralRe: C# 2010 working with xml Pin
BobJanova22-Aug-12 6:17
BobJanova22-Aug-12 6:17 
GeneralRe: C# 2010 working with xml Pin
sc steinhayse22-Aug-12 16:37
sc steinhayse22-Aug-12 16:37 
GeneralRe: C# 2010 working with xml Pin
BobJanova22-Aug-12 23:44
BobJanova22-Aug-12 23:44 
QuestionHow to avoid flickering in a user control in .Net Compact Framework/C# ? Pin
topksharma198221-Aug-12 21:27
topksharma198221-Aug-12 21:27 
Hi All,

I have created a user control which draws some items on a bitmap. This control is scrollable and we can also pan it.
I am using Microsof.Gesture/PhysicsEngine library for controlling gestures.

The full scenario is like I create the full bitmap only once and after that when I do any gesture like scroll or pan i just show particuler portion of the bitmap but it has lot of flickering. Following is the code sample:

C#
protected override void OnPaintBackground(PaintEventArgs e)
    {

    }
    private Bitmap _cachedBitmap;
    protected override void OnPaint(PaintEventArgs e)
    {
        using (Graphics g = e.Graphics)
        {
            if (!_isPainted)
            {
                _cachedBitmap = new Bitmap(ClientRectangle.Width, ClientRectangle.Height);
                InitilizeBitmap(g);
                _isPainted = true;
            }

            //Rectangle to show a particular portion of bitmap.
            Rectangle rec = new Rectangle(0, _bitmapLocation.Y, ClientRectangle.Width, ClientRectangle.Height);
            //using (Graphics gCached = Graphics.FromImage(_cachedBitmap))
            //{
            //   gCached.Clear(BackColor);
            //   gCached.DrawImage(_bmpControl, 0, 0, rec, GraphicsUnit.Pixel);
            //}

            //g.DrawImage(_cachedBitmap, 0, 0);
            g.DrawImage(_bmpControl, 0, 0, rec, GraphicsUnit.Pixel);
        }
    }


Any idea how can I avoid flickering ?
Praveen Sharma

AnswerRe: How to avoid flickering in a user control in .Net Compact Framework/C# ? Pin
BobJanova22-Aug-12 0:43
BobJanova22-Aug-12 0:43 
GeneralRe: How to avoid flickering in a user control in .Net Compact Framework/C# ? Pin
topksharma198222-Aug-12 1:16
topksharma198222-Aug-12 1:16 
GeneralRe: How to avoid flickering in a user control in .Net Compact Framework/C# ? Pin
BobJanova22-Aug-12 2:10
BobJanova22-Aug-12 2:10 
AnswerRe: How to avoid flickering in a user control in .Net Compact Framework/C# ? Pin
Pete O'Hanlon22-Aug-12 1:27
mvePete O'Hanlon22-Aug-12 1:27 
GeneralRe: How to avoid flickering in a user control in .Net Compact Framework/C# ? Pin
topksharma198223-Aug-12 10:16
topksharma198223-Aug-12 10:16 
QuestionRe: How to avoid flickering in a user control in .Net Compact Framework/C# ? Pin
Eddy Vluggen22-Aug-12 3:11
professionalEddy Vluggen22-Aug-12 3:11 
AnswerRe: How to avoid flickering in a user control in .Net Compact Framework/C# ? Pin
topksharma198223-Aug-12 10:16
topksharma198223-Aug-12 10:16 
GeneralRe: How to avoid flickering in a user control in .Net Compact Framework/C# ? Pin
Eddy Vluggen23-Aug-12 10:31
professionalEddy Vluggen23-Aug-12 10:31 
QuestionEPPLUS Excel Pin
Member 916988721-Aug-12 20:48
Member 916988721-Aug-12 20:48 
AnswerRe: EPPLUS Excel Pin
Pete O'Hanlon21-Aug-12 21:01
mvePete O'Hanlon21-Aug-12 21:01 
QuestionEPPLUS Excel Pin
Member 916988721-Aug-12 14:37
Member 916988721-Aug-12 14:37 
QuestionUsing IList.Contains<> to search nested members? Pin
JoeRip21-Aug-12 14:25
JoeRip21-Aug-12 14:25 
SuggestionRe: Using IList.Contains<> to search nested members? Pin
Matt T Heffron21-Aug-12 15:11
professionalMatt T Heffron21-Aug-12 15:11 
GeneralRe: Using IList.Contains to search nested members? Pin
JoeRip21-Aug-12 15:15
JoeRip21-Aug-12 15:15 
GeneralRe: Using IList.Contains to search nested members? Pin
Matt T Heffron21-Aug-12 15:27
professionalMatt T Heffron21-Aug-12 15:27 
AnswerRe: Using IList.Contains<> to search nested members? Pin
BobJanova22-Aug-12 0:41
BobJanova22-Aug-12 0:41 
Questionplz help with ghe following.... Pin
joy madalane21-Aug-12 12:59
joy madalane21-Aug-12 12:59 

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.