Public Class Form1 Private img As New Bitmap(500, 250) Private gf As Graphics 'Private A0 As Double = 1 Dim MinA As Double, MaxA As Double, dM As Double Dim A As Double, DA As Double, H As Integer, W As Integer Private Sub drawGrad() '目盛表示 Dim X As Double, IX As Integer, HH As Integer = H \ 10, i As Integer Dim P1 As Pen = New Pen(Color.Gray), P2 As Pen = New Pen(Color.Black) For i = 1 To 9 If (i Mod 5) = 0 Then gf.DrawLine(P2, 0, i * HH, W, i * HH) Else gf.DrawLine(P1, 0, i * HH, W, i * HH) End If Next X = 0.0 : i = 0 Do While X < MaxA X = X + dM : i = i + 1 If X > MinA Then IX = (X - MinA) / (MaxA - MinA) * W If IX >= 0 And IX < W Then If (i Mod 5) = 0 Then gf.DrawLine(P2, IX, 0, IX, 254) Else gf.DrawLine(P1, IX, 0, IX, 254) End If End If End If Loop End Sub Private Sub initData() gf = Graphics.FromImage(img) : gf.Clear(Color.White) '描画クリア MinA = Val(TextBox1.Text) MaxA = Val(TextBox2.Text) dM = Val(TextBox3.Text) A = MinA : DA = (MaxA - MinA) / 200000 H = img.Height : W = img.Width End Sub Private Sub drawMap() Dim i As Integer, IX As Integer, IY As Integer, X As Double drawGrad() X = 0.1 For i = 1 To 200000 IY = H - X * H + 0.5 : IX = (A - MinA) / (MaxA - MinA) * W + 0.5 If IX >= 0 And IX < W And IY >= 0 And IY < H Then img.SetPixel(IX, IY, Color.Blue) X = A * X * (1 - X) : A = A + DA Next PictureBox1.Image = img : gf.Dispose() 'リソースを解放する End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click initData() : drawMap() End Sub End Class