タイトル : 温度の等高線 投稿日 : 2008/01/30(Wed) 10:11 投稿者 : BB
VB6.0で温度の等高線のようなものを書きたいと思っています。 3600×4800のFormで、式は T1 = 5 * Sin(pai * X / 2400) * Sin(pai * Y / 2400) + 25 この式で20〜30℃までを色分けしたいのですが思ったようにうまくはいきません。 もし、いい案などありましたら、教えていただきたいと思います。 よろしくお願いします。 一応、書いたものを下に張ります。 Private Sub Form_Click() Dim pai As Single Dim i As Single Static T1 As Single Static X As Single Static Y As Single Static T As Single DrawWidth = 3 Line (2400, -1800)-(2400, 1800), QBColor(0) Line (2400, 1800)-(-2400, 1800), QBColor(0) DrawWidth = 1 Line (2400, -1800)-(-2400, -1800), QBColor(0) Line (-2400, -1800)-(-2400, 1800), QBColor(0) Line (-2400, 0)-(2400, 0), QBColor(5) Line (0, 1800)-(0, -1800), QBColor(5) pai = 3.14159 T1 = 5 * Sin(pai * X / 2400) * Sin(pai * Y / 2400) + 25 If T1 > 28 And T1 <= 28 Then PSet (X, Y), RGB(255, 0, 0) If T1 > 26 And T1 <= 28 Then PSet (X, Y), RGB(255, 200, 0) If T1 > 24 And T1 <= 26 Then PSet (X, Y), RGB(255, 255, 0) If T1 > 22 And T1 <= 24 Then PSet (X, Y), RGB(0, 255, 0) If T1 >= 20 And T1 <= 22 Then PSet (X, Y), RGB(0, 0, 255) End If End If End If End If End If End Sub |