2024/04/10(Wed) 04:59:11 編集(投稿者)
■No103049 (ぴーよ さん) に返信
> Formのダブルバッファーを使うわけなので、
> GUIスレッドを使用しているのでしょうか?
マルチスレッドで使う場合は、BufferedGraphicsContext を作成してください。
Dim bmp As New Bitmap(bmpSize.Width, bmpSize.Height)
Using g = Graphics.FromImage(bmp)
Dim dc = g.GetHdc()
Using bufferContext As New BufferedGraphicsContext()
Using bufferedGraphics = bufferContext.Allocate(dc, New Rectangle(Point.Empty, bmpSize))
bufferedGraphics.Graphics.Clear(backColor)
DrawReversibleLine(bufferedGraphics.Graphics, ......
bufferedGraphics.Render()
End Using
End Using
g.ReleaseHdc()
End Using