用鼠标在对话框上画矩形,总是闪烁的很厉害

解决方案 »

  1.   

    Double Buffering With GDI+ (in C++)
    http://www.codeproject.com/vcpp/gdiplus/gdiplus.aspAsteriods in C# Using GDI+
    http://www.csharphelp.com/archives2/archive357.htmlHow do I create flicker free animation in GDI+?
    http://www.c-sharpcorner.com/FAQ/FlickerFreeAnimation.asp"....
    Double buffering in C# was actually pretty simple. Just add this in the constructor of a class inheriting from System.Windows.Forms.Form.// Activates double buffering
    SetStyle(ControlStyles.UserPaint, true);
    SetStyle(ControlStyles.AllPaintingInWmPaint, true);
    SetStyle(ControlStyles.DoubleBuffer, true);No you can go along and paint anything in the OnPaint method, and the system will deal with the Double buffering.
    ......"