Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Make polyline appear crisp and clear in small content control (wpf)

1 view
Skip to first unread message

moondaddy

unread,
May 7, 2008, 11:20:45 PM5/7/08
to

Hi, I have 3 tiny content controls and each has a Path in it to draw some lines.  These need to be very small and I'm having trouble making the lines clear.  the lines have a stroke thickness of "1", but when I run the app, they become pixilated and blur out.  Can someone please help me on this?

Thanks.

 

<Grid HorizontalAlignment="Left" Margin="10,0,0,0" Width="11" Height="33">

<Grid.RowDefinitions>

<RowDefinition Height="10" />

<RowDefinition Height="1" />

<RowDefinition Height="10" />

<RowDefinition Height="1" />

<RowDefinition Height="10" />

</Grid.RowDefinitions>

<!-- Single Line Connection-->

<ContentControl Grid.Row="0">

<Border BorderBrush="#FF016491" BorderThickness="1,1,1,1" >

<Path Stroke="Blue" StrokeThickness="1">

<Path.Data>

<PathGeometry>

<PathFigure StartPoint="2,4">

<LineSegment Point="7,4"/>

</PathFigure>

</PathGeometry>

</Path.Data>

</Path>

</Border>

</ContentControl>

<!-- One to Many Connection-->

<ContentControl Grid.Row="2">

<Border BorderBrush="#FF016491" BorderThickness="1,1,1,1" >

<Path Stroke="Blue" StrokeThickness="1">

<Path.Data>

<PathGeometry>

<PathFigure StartPoint="2,2">

<LineSegment Point="5,2"/>

<LineSegment Point="5,6"/>

<LineSegment Point="2,6"/>

</PathFigure>

<PathFigure StartPoint="5,4">

<LineSegment Point="8,4"/>

</PathFigure>

</PathGeometry>

</Path.Data>

</Path>

</Border>

</ContentControl>

<!-- Many to Many Connection-->

<ContentControl Grid.Row="4">

<Border BorderBrush="#FF016491" BorderThickness="1,1,1,1" >

<Path Stroke="Blue" StrokeThickness="1">

<Path.Data>

<PathGeometry>

<PathFigure StartPoint="0,2">

<LineSegment Point="3,2"/>

<LineSegment Point="3,6"/>

<LineSegment Point="0,6"/>

</PathFigure>

<PathFigure StartPoint="3,4">

<LineSegment Point="6,4"/>

</PathFigure>

<PathFigure StartPoint="9,2">

<LineSegment Point="6,2"/>

<LineSegment Point="6,6"/>

<LineSegment Point="9,6"/>

</PathFigure>

</PathGeometry>

</Path.Data>

</Path>

</Border>

</ContentControl>

</Grid>
 

Peter Morris

unread,
May 8, 2008, 3:11:31 AM5/8/08
to
Does <Path SnapsToDevicePixels="True" .........> make it any clearer?


moondaddy

unread,
May 8, 2008, 3:45:24 AM5/8/08
to
It's hard to tell, but I dont think so.

"Peter Morris" <mrpmorris at gmail dot com> wrote in message
news:%23HajHxN...@TK2MSFTNGP04.phx.gbl...

Linda Liu[MSFT]

unread,
May 8, 2008, 5:55:08 AM5/8/08
to
Hi Moondaddy,

> the lines have a stroke thickness of "1", but when I run the app, they
become pixilated and blur out.

I paste your sample code into my test project and run the application, but
I didn't see the lines blur out on my side. They are very clear.

If you change the StokeThickness property of the Path elements to 0.5, will
the lines become clear?

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msd...@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


Linda Liu[MSFT]

unread,
May 12, 2008, 7:19:28 AM5/12/08
to
Hi Moondaddy,

How about the problem now?

If the problem is still not solved, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msd...@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.


moondaddy

unread,
May 14, 2008, 2:13:00 PM5/14/08
to
Yes, I'm still having the problem. I'm putting the images in a canvas now
instead of in a grid which seemed to help a little bit. one thing I noticed
is that because the detail is so small, that as I resize or move the parent
container, the pixels in the image move just a very little from clear to
fuzzy and back again. I guess that the precision is just to small and the
slightest change in location effect how it can be visualized.


"Linda Liu[MSFT]" <v-l...@online.microsoft.com> wrote in message
news:fi4fjGPs...@TK2MSFTNGHUB02.phx.gbl...

Linda Liu[MSFT]

unread,
May 15, 2008, 6:50:43 AM5/15/08
to
Hi Moondaddy,

Thank you for your reply!

I did see the problem you described on my side.

Even though I add the SnapsToDevicePixels attribute in the Canvas element
in XAML file and set value of this attribute to true, the problem still
exists.

I will report this issue to our product team.

You can also submit a product feedback about this issue in the Microsoft
Connect web site:
http://connect.microsoft.com/VisualStudio/Feedback

Thank you for your contribution to Microsoft Product!

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msd...@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.


moondaddy

unread,
May 15, 2008, 12:07:09 PM5/15/08
to
OK thanks.

"Linda Liu[MSFT]" <v-l...@online.microsoft.com> wrote in message

news:3TGVLmnt...@TK2MSFTNGHUB02.phx.gbl...

Linda Liu[MSFT]

unread,
May 20, 2008, 9:30:34 PM5/20/08
to
Hi George,

I have report this issue to our product team and the reply is that we could
add the RenderOptions.EdgeMode="Aliased" to the top-level Grid element to
make polyline appear clear.

For example,


<Grid HorizontalAlignment="Left" Margin="10,0,0,0" Width="11" Height="33"

SnapsToDevicePixels="True" RenderOptions.EdgeMode="Aliased">

Hope this helps.

moondaddy

unread,
May 31, 2008, 1:21:08 AM5/31/08
to
Thanks that worked really good for straight lines. In one of my controls
where I used this, it had an ellipse which looked a bit goofy, but I may
replace that with an image to get around it.


"Linda Liu[MSFT]" <v-l...@online.microsoft.com> wrote in message

news:lV9PKJuu...@TK2MSFTNGHUB02.phx.gbl...

Linda Liu[MSFT]

unread,
Jun 2, 2008, 4:31:39 AM6/2/08
to
Hi George,

Thank you for your feedback and sharing with us how you solved the problem
successfully!

If you have any other questions in the future, please don't hesitate to
contact us. It's always our pleasure to be of assistance.

Have a good day!

0 new messages