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. C#
  4. How do i draw a smooth linie [modified]

How do i draw a smooth linie [modified]

Scheduled Pinned Locked Moved C#
question
3 Posts 2 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.
  • M Offline
    M Offline
    MarkPhB
    wrote on last edited by
    #1

    i want to create a shape Control like that you got here. But his Control can t draw antialiased linies =/ How can i draw smooth linies ?

    M 1 Reply Last reply
    0
    • M MarkPhB

      i want to create a shape Control like that you got here. But his Control can t draw antialiased linies =/ How can i draw smooth linies ?

      M Offline
      M Offline
      Mark Churchill
      wrote on last edited by
      #2

      If I recall theres some settings on the Graphics object that can help you out. Anti-aliasing is more of a quality setting on the Graphics object, than specifically asking for the thing you are drawing to be smoothed.

      Mark Churchill Director Dunn & Churchill

      M 1 Reply Last reply
      0
      • M Mark Churchill

        If I recall theres some settings on the Graphics object that can help you out. Anti-aliasing is more of a quality setting on the Graphics object, than specifically asking for the thing you are drawing to be smoothed.

        Mark Churchill Director Dunn & Churchill

        M Offline
        M Offline
        MarkPhB
        wrote on last edited by
        #3

        Yea i use this already but it looks not really Antialiased =/ the edges of a pie, for example, looks fuzzy but not smoothed I have a Custom Control wich inherits from the Control class and my paint code looks like this

        protected override void OnPaint( PaintEventArgs e ) {
            base.OnPaint( e );
        
            if( ( this.Width <= 0 ) || ( this.Height <= 0 ) ) return;
        
            e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
        
            GraphicsPath path = createGraphicPath( Shapes.Pie);
        
            this.Region = new Region( path );
        
            Pen pen = new Pen( new SolidBrush( borderColor_ ), borderWidth_ );
            pen.DashStyle = borderStyle_;
        
            e.Graphics.DrawPath( pen, path );
        
            path.Dispose();
            pen.Dispose();
        }
        
        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