本文整理匯總了VB.NET中System.Drawing.Graphics.DrawEllipse方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET Graphics.DrawEllipse方法的具體用法?VB.NET Graphics.DrawEllipse怎麽用?VB.NET Graphics.DrawEllipse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Drawing.Graphics
的用法示例。
在下文中一共展示了Graphics.DrawEllipse方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: DrawEllipseRectangle
Private Sub DrawEllipseRectangle(ByVal e As PaintEventArgs)
' Create pen.
Dim blackPen As New Pen(Color.Black, 3)
' Create rectangle for ellipse.
Dim rect As New Rectangle(0, 0, 200, 100)
' Draw ellipse to screen.
e.Graphics.DrawEllipse(blackPen, rect)
End Sub
示例2: DrawEllipseRectangleF
Private Sub DrawEllipseRectangleF(ByVal e As PaintEventArgs)
' Create pen.
Dim blackPen As New Pen(Color.Black, 3)
' Create rectangle for ellipse.
Dim rect As New RectangleF(0.0F, 0.0F, 200.0F, 100.0F)
' Draw ellipse to screen.
e.Graphics.DrawEllipse(blackPen, rect)
End Sub
示例3: DrawEllipseInt
Private Sub DrawEllipseInt(ByVal e As PaintEventArgs)
' Create pen.
Dim blackPen As New Pen(Color.Black, 3)
' Create location and size of ellipse.
Dim x As Integer = 0
Dim y As Integer = 0
Dim width As Integer = 200
Dim height As Integer = 100
' Draw ellipse to screen.
e.Graphics.DrawEllipse(blackPen, x, y, width, height)
End Sub
示例4: DrawEllipseFloat
Private Sub DrawEllipseFloat(ByVal e As PaintEventArgs)
' Create pen.
Dim blackPen As New Pen(Color.Black, 3)
' Create location and size of ellipse.
Dim x As Single = 0.0F
Dim y As Single = 0.0F
Dim width As Single = 200.0F
Dim height As Single = 100.0F
' Draw ellipse to screen.
e.Graphics.DrawEllipse(blackPen, x, y, width, height)
End Sub
示例5: Graphics.DrawEllipse(Pen, Int x, Int y, Int w, Int h)
' 導入命名空間
Imports System
Imports System.Windows.Forms
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing.Imaging
Imports System.Drawing
Public Class MainClass
Shared Sub Main()
Dim bm As New Bitmap(256, 256)
' Draw on it.
Dim gr As Graphics = Graphics.FromImage(bm)
gr.Clear(Color.White)
gr.DrawEllipse(Pens.Red, 0, 0, bm.Width - 1, bm.Height - 1)
gr.DrawLine(Pens.Green, 0, 0, bm.Width - 1, bm.Height - 1)
gr.DrawLine(Pens.Blue, bm.Width - 1, 0, 0, bm.Height - 1)
' Save the result as a JPEG file.
bm.Save("test.gif", ImageFormat.Gif)
End Sub
End Class