2024/04/10(Wed) 04:57:46 編集(投稿者)
BufferedGraphicsManager(Windows Forms のダブルバッファ) に描画してから転送するとうまくいくみたいです。
Dim bmpSize = New Size(100, 100)
Dim bmp As New Bitmap(bmpSize.Width, bmpSize.Height)
Using g = Graphics.FromImage(bmp)
Dim dc = g.GetHdc()
' ダブルバッファを作成
Dim bufferContext = BufferedGraphicsManager.Current
Using bufferedGraphics = bufferContext.Allocate(dc, New Rectangle(Point.Empty, bmpSize))
' bufferedGraphics.Graphics に対して描画
bufferedGraphics.Graphics.Clear(backColor)
DrawReversibleLine(bufferedGraphics.Graphics, New Point(0, 0), New Point(100, 100).....
'描画内容を転送
bufferedGraphics.Render()
End Using
g.ReleaseHdc()
End Using