|
■No103196 (ろん さん) に返信
うーむ。どうなんでしょう?
Imports System.Drawing
Module Module1
Sub Main()
Dim width As Integer = 200
Dim height As Integer = 300
Dim padding As Integer = 10
Dim tilt As Integer = 100
Dim rect As Rectangle = Rectangle.FromLTRB(padding, padding,
width - padding, height - padding)
Using canvas As New Bitmap(width, height)
Using g As Graphics = Graphics.FromImage(canvas)
g.Clear(Color.White)
g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
Dim pen As New Pen(Color.Black, 10)
Dim points As PointF() = New PointF() {
New PointF(rect.Left + tilt, rect.Top), ' 左上隅
New PointF(rect.Left, rect.Bottom), ' 左下隅
New PointF(rect.Right - tilt, rect.Bottom), ' 右下隅
New PointF(rect.Right, rect.Top) ' 右上隅
}
g.DrawPolygon(pen, points)
End Using
canvas.Save("hoge.png")
End Using
End Sub
End Module
|