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

  • Home
  • SEARCH
  • 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

Related Questions

How to get the path of the current csproject? Let's say I have a
I have a full path which I would like to remove certain levels of
I have a virtual path (example: ~/Images/Banner.jpg) and I want to make that an
My path to a 'fulltime'- developer stated as a analyst using VBA with Excel,
A path in Perforce contains files a.txt and b.txt. I'll refer to the main
Given a path such as "mydir/myfile.txt" , how do I find the file's absolute
In ruby the library path is provided in $: , in perl it's in
Given a string file path such as /foo/fizzbuzz.bar , how would I use bash
When setting the export path in Unix, example: export PATH=$PATH: $EC2_HOME/bin If I quit
Having a relative path, how do I turn it into an absolute one from

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.