私のアプローチの問題は、フォームのサイズを変更するときに、描画された画像、テキスト、または線がおそらく0.2秒遅れることです。したがって、右下隅に画像が必要な場合は、サイズ変更後、0.2秒で配置されます。また、大幅なサイズ変更を行うと、フォームが大画面で拡大する間、1-2FPSまで遅れ始めます。サンプルコードは次のようになります(VB.NET):
Public Class Form1
Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(e)
Dim icon As Icon = SystemIcons.Exclamation
Dim imageWidth As Integer = icon.Width
Dim imageHeight As Integer = icon.Height
e.Graphics.DrawIcon(icon, Me.ClientRectangle.Right - imageWidth,
Me.ClientRectangle.Bottom - imageHeight)
End Sub
Private Sub Form1_Resize(sender As Object, e As System.EventArgs) Handles Me.Resize
Me.Invalidate()
End Sub
End Class
スムーズにするためにできることはありますか?