Imports Microsoft.VisualBasic.FileIO Public Class Form1 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click End End Sub Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged Select Case ListBox1.SelectedItem Case "ƒJƒXƒ^ƒ€" Case "‚`‚S" ' ‚`‚SF210mm~297mm paperXsize.Value = 2400 paperYsize.Value = 1200 Case "‚a‚S" ' ‚a‚SF257mm~364mm paperXsize.Value = 3200 paperYsize.Value = 1600 Case "‚`‚R" ' ‚`‚RF297mm~420mm paperXsize.Value = 3600 paperYsize.Value = 1800 Case "‚w‚f‚`i1024~768j" paperXsize.Value = 1000 paperYsize.Value = 500 End Select End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ListBox1.SelectedIndex = 1 End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Using parser As New TextFieldParser(" C:\Documents and Settings\yoshiya\ƒfƒXƒNƒgƒbƒv\YBSC5.csv ", System.Text.Encoding.GetEncoding("SHIFT_JIS")) parser.TextFieldType = FieldType.Delimited parser.HasFieldsEnclosedInQuotes = True parser.SetDelimiters(",") Dim path As String = " C:\Documents and Settings\yoshiya\ƒfƒXƒNƒgƒbƒv\YBSC5o.jsf" Dim outtext As IO.StreamWriter Dim Radius As Single Dim PaperX As Single, PaperY As Single outtext = New IO.StreamWriter(path, False, System.Text.Encoding.Default) Dim dumfields As String() = parser.ReadFields() Trace.Write("fw.createFireworksDocument({x:" & Str(paperXsize.Value) & ",y:" & Str(paperYsize.Value) & "},{pixelsPerUnit:100,units:""cm""},""#ffffff"");") outtext.Write("fw.createFireworksDocument({x:" & Str(paperXsize.Value) & ",y:" & Str(paperYsize.Value) & "},{pixelsPerUnit:100,units:""cm""},""#ffffff"");") Trace.WriteLine("") outtext.WriteLine("") While Not parser.EndOfData Dim fields As String() = parser.ReadFields() If fields(3) > 3.5 Then Exit While Radius = StarRadius(fields(3), 12) PaperX = RAtoX(Val(fields(1))) PaperY = DECtoY(Val(fields(2))) Trace.Write(fwCircle(PaperX, PaperY, Radius)) outtext.Write(fwCircle(PaperX, PaperY, Radius)) Trace.WriteLine("") outtext.WriteLine("") End While outtext.Close() End Using End Sub Public Function StarRadius(ByVal Vmag As Single, ByVal maxstarR As Integer) As Integer StarRadius = maxstarR / 10 ^ (0.2 * Vmag) Exit Function End Function Public Function RAtoX(ByVal RA As Single) As Single Dim maxpaperX As Integer = Val(paperXsize.Value) Dim maxRA As Single = 24 RAtoX = maxpaperX + (-RA * (maxpaperX / maxRA)) Exit Function End Function Public Function DECtoY(ByVal DEC As Single) As Single Dim maxpaperY As Integer = Val(paperYsize.Value) Dim maxDEC As Single = 90, minDEC As Single = -90 DECtoY = -(maxpaperY / (maxDEC - minDEC)) * DEC + maxpaperY * maxDEC / (maxDEC - minDEC) Exit Function End Function Public Function fwCircle(ByVal X As Single, ByVal Y As Single, ByVal R As Single) As String 'ex. script Dim leftX As Single, topY As Single, rightX As Single, bottomY As Single Dim comString As String = "fw.getDocumentDOM().addNewOval({" leftX = X - R topY = Y + R rightX = X + R bottomY = Y - R fwCircle = comString & "left:" & Str(leftX) & ",top:" & Str(topY) & ",right:" & Str(rightX) & ",bottom:" & Str(bottomY) & "});" Exit Function End Function End Class