Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 546739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:53:56+00:00 2026-05-13T10:53:56+00:00

Why the Path and Polyline have different renderings in WPF? This is happening both

  • 0

Why the Path and Polyline have different renderings in WPF?

This is happening both in code and blend, maybe a I missing something or this
is just a anti aliasing effect.

<Window
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 x:Class="GeometryMonky.Window1"
 x:Name="Window"
 Title="Window1"
 Width="640" Height="480" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

 <Grid x:Name="LayoutRoot">
  <Path Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FF0000FF" Margin="100,10,0,0" Data="M289,39 L333,173" Width="1" HorizontalAlignment="Left" Height="100" StrokeThickness="1"/>

  <Polyline Stroke="#FF0000FF" Margin="115,178,417,168" StrokeThickness="1" Width="100" Height="100">
   <Polyline.Points>
    <Point>10,0</Point>
    <Point>10,100</Point>
   </Polyline.Points>
  </Polyline>
 </Grid>
</Window>

Image sample from Blend:
http://img190.imageshack.us/img190/2965/wpfsmaple.png

Development system:
WinXP SP2, VS 2008 + SP1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:53:56+00:00Added an answer on May 13, 2026 at 10:53 am

    It has to do with drawing modes of non-text objects. I tried setting the polyline object like the article linked below says and it does make it look just like the path.

    So, short answer is it has to do with anti-aliasing. Here is the article: Single Pixel Lines

    If you want the command here it is, give your polyline a Name and then add the following to the code behind.

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            this.InitializeComponent();
            // THIS IS THE LINE THATS IMPORTANT
            pLine.SetValue(RenderOptions.EdgeModeProperty, EdgeMode.Aliased);
       }
    }
    

    Your xaml change here:

    <Polyline x:Name="pLine" Stroke="#FF0000FF" Margin="115,178,417,168" StrokeThickness="1" Width="100" Height="100">
      <Polyline.Points>
        <Point>10,0</Point>
        <Point>10,100</Point>
       </Polyline.Points>
    </Polyline>
    

    This will make your polyline object look just like your Path object. However changing the Path to use unspecified does not do anything so you can make your other objects look similar to the path but not vice versa.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 350k
  • Answers 350k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The power of ten, that you need to multiply the… May 14, 2026 at 7:06 am
  • Editorial Team
    Editorial Team added an answer Sure. These refer to conditional compilation symbols which can be… May 14, 2026 at 7:06 am
  • Editorial Team
    Editorial Team added an answer I'd say it's not bad to have such info hardcoded… May 14, 2026 at 7:06 am

Related Questions

I'm having a problem with Jet throwing error 3011 when I try to use
My Django 1.1 app uses dynamic images. I'm confused about why the path generated
Consider a Button composed of many graphical elements (and Path ) drawn on Canvas
I'm using Windows 7 and I'm trying to list all the files in MyDocuments.
I want to retrieve the recently viewed pictures from IE. I know that all

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.