當前位置: 首頁>>代碼示例>>VB.NET>>正文


VB.NET Graphics.DrawEllipse方法代碼示例

本文整理匯總了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
開發者ID:VB.NET開發者,項目名稱:System.Drawing,代碼行數:11,代碼來源:Graphics.DrawEllipse

示例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
開發者ID:VB.NET開發者,項目名稱:System.Drawing,代碼行數:11,代碼來源:Graphics.DrawEllipse

示例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
開發者ID:VB.NET開發者,項目名稱:System.Drawing,代碼行數:14,代碼來源:Graphics.DrawEllipse

示例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
開發者ID:VB.NET開發者,項目名稱:System.Drawing,代碼行數:14,代碼來源:Graphics.DrawEllipse

示例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
開發者ID:VB程序員,項目名稱:System.Drawing,代碼行數:25,代碼來源:Graphics.DrawEllipse


注:本文中的System.Drawing.Graphics.DrawEllipse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。