程序如下:
Dim ForePen = Pens.Green Dim ForeBrush = Brushes.Green Dim Lines = 22, Sqs = 23 Dim LineSpace = 10 Dim SqW = 30, SqH = 30 Dim PageW = Sqs * SqW + 720 * 0, PageH = (Lines + 1) * (SqH + LineSpace) + LineSpace Dim Origin = New Point(35, 50) MyGraphics.DrawLine(ForePen, Origin, Origin + New Point(PageW, 0)) MyGraphics.DrawLine(ForePen, Origin + New Point(0, LineSpace), Origin + New Point(PageW, 0) + New Point(0, LineSpace)) MyGraphics.DrawLine(ForePen, Origin, Origin + New Point(0, PageH)) MyGraphics.DrawLine(ForePen, Origin + New Point(PageW, 0), Origin + New Point(0, PageH) + New Point(PageW, 0)) For y = 0 To Lines MyGraphics.DrawLine(ForePen, Origin + New Point(0, y * (SqH + LineSpace) + LineSpace), Origin + New Point(PageW, y * (SqH + LineSpace) + LineSpace)) For x = 0 To Sqs MyGraphics.DrawLine(ForePen, Origin + New Point(x * (SqW), y * (SqH + LineSpace) + LineSpace), Origin + New Point(x * (SqW), y * (SqH + LineSpace) + SqH + LineSpace)) Next MyGraphics.DrawLine(ForePen, Origin + New Point(0, y * (SqH + LineSpace) + SqH + LineSpace), Origin + New Point(PageW, y * (SqH + LineSpace) + SqH + LineSpace)) Next MyGraphics.DrawLine(ForePen, Origin + New Point(0, PageH), Origin + New Point(PageW, PageH)) MyGraphics.DrawString("第 页, 共 页", New Font("宋体", 13), ForeBrush, Origin + New Point(PageW - 150, -20)) MyGraphics.DrawString(Sqs.ToString & "×" & Lines.ToString & "=" & (Sqs * Lines).ToString & "字", New Font("宋体", 13), ForeBrush, Origin + New Point(PageW - 150, PageH + 3)) MyGraphics.DrawString("作文纸 Generated at " & Now.ToString & " http://twd2.me", New Font("宋体", 13), ForeBrush, Origin + New Point(0, PageH + 3)) PictureBox1.Refresh()
酌情处理吧。
DT啊 直接画一个就好了 非得写出来
我就是写程序画