Use Graphics Path Iterator to get the Path information : Graphics Path Iterator « 2D « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » 2D » Graphics Path IteratorScreenshots 
Use Graphics Path Iterator to get the Path information
Use Graphics Path Iterator to get the Path information

Imports System
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Text
Imports System.Drawing.Imaging

Public Class MainClass

  Shared Sub Main()
    Dim As GraphicsPath = New GraphicsPath()
    Dim pts() As PointF = {New PointF(50.0F50.0F), _
                       New PointF(150.0F25.0F), _
                       New PointF(200.0F50.0F)}
    p.AddCurve(pts)
    p.AddRectangle(New Rectangle(60605050))
    p.AddPie(1001008080035)

    Dim iter As GraphicsPathIterator = New GraphicsPathIterator(p)
    Console.WriteLine("Num pts in path = " & iter.Count.ToString())
    Console.WriteLine("Num subpaths in path = " & iter.SubpathCount.ToString())
    Console.WriteLine("Path has curve = " + iter.HasCurve().ToString())

    Dim StartIndex As Int32
    Dim EndIndex As Int32
    Dim As Int32
    Dim IsClosed As Boolean
    ' Rewind the Iterator.
    iter.Rewind()
    ' List the Subpaths.
    For i = To iter.SubpathCount - 1
      iter.NextSubpath(StartIndex, EndIndex, IsClosed)
      Console.WriteLine("Start: " + StartIndex.ToString() + _
                         "  End: " + EndIndex.ToString() + _
                         "  IsClosed: " + IsClosed.ToString())
    Next
  End Sub
  
End Class



           
       
Related examples in the same category
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.