私は、OnPaintイベントをオーバーライドして500ポイントのグラフを描画するInherited Panelコンポーネントを持っています。私はグラフ上でいくつかの選択をする必要があるので、それはちらついている。このDoubleBufferedプロパティが見つかりましたが、PanelコンストラクタでTrueに設定すると、描画が消えます。私はそれをデバッグし、描画メソッドはまだ実行するが、パネル上には何もないことがわかります。 誰もがなぜこれが起こるのか知っていますか?Panel DoubleBufferedプロパティが描画を停止し、不可視です
これは.NET 3.5 - C#です。リサイズアプリケーション
try
{
Graphics g = e.Graphics;
//Draw _graphArea:
g.DrawRectangle(Pens.Black, _graphArea);
_drawingObjectList.DrawGraph(g, _mainLinePen, _diffLinePen, _dotPen, _dotBrush, _notSelectedBrush, _selectedBrush);
DrawSelectionRectangle(g);
g.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
パネルの子孫のコンストラクタ:
this.BackColor = Color.White;
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
this.UpdateStyles();
これは.Netと思われますか?言語? – rene
@reneはい、そうです。ごめんなさい。 C#。それは今問題になっている。 – elector
あなたの描画コードを教えてもらえますか? – FreeAsInBeer