Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. GDI+ How to limit number of PathPoints in GraphicsPath [modified]

GDI+ How to limit number of PathPoints in GraphicsPath [modified]

Scheduled Pinned Locked Moved Graphics
winformsgraphicstutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shipstech
    wrote on last edited by
    #1

    My application is a scrolling histogram. With each tick of the clock I add another rectangle to the graphicspath and then use TranslateTransform() to scale and "scroll" the data. Unfortunately this app must run 24/7 for weeks (months?!) at a time so the GraphicsPath gets very big. Does anyone know a way to remove PathPoints from a GraphicsPath? Something better than the following barebones class? Thanks for having a look. Public Class SizeLimitedGraphicsPath Private Gp1 As New GraphicsPath Private Gp2 As New GraphicsPath Private ActivePtr As GraphicsPath Private InActivePtr As GraphicsPath Private NextActiveGp As Integer Private _minimumSize As Integer Public Sub New(ByVal MinimumSize As Integer) _minimumSize = MinimumSize ActivePtr = Gp1 InActivePtr = Gp2 NextActiveGp = 2 End Sub Public Sub AddRectangle(ByVal rect As RectangleF) Gp1.AddRectangle(rect) Gp2.AddRectangle(rect) SwapIfNecessary() End Sub Public ReadOnly Property gp() As GraphicsPath Get Return ActivePtr End Get End Property Private Sub SwapIfNecessary() If InActivePtr.PointCount > _MinimumSize Then If NextActiveGp = 1 Then ActivePtr = Gp1 InActivePtr = Gp2 Gp2.Reset() NextActiveGp = 2 Else ' Nextgp = 2 ActivePtr = Gp2 InActivePtr = Gp1 Gp1.Reset() NextActiveGp = 1 End If End If End Sub End Class Wfanning@gso.uri.edu -- modified at 8:29 Monday 18th June, 2007

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups