473,231 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

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

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>

--
mo*******@newsgroup.nospam
Jun 27 '08 #1
10 5419
Does <Path SnapsToDevicePixels="True" .........make it any clearer?
Jun 27 '08 #2
It's hard to tell, but I dont think so.

"Peter Morris" <mrpmorris at gmail dot comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Does <Path SnapsToDevicePixels="True" .........make it any clearer?

Jun 27 '08 #3
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:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jun 27 '08 #4
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:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
Jun 27 '08 #5
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-****@online.microsoft.comwrote in message
news:fi**************@TK2MSFTNGHUB02.phx.gbl...
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:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.


Jun 27 '08 #6
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:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
Jun 27 '08 #7
OK thanks.

"Linda Liu[MSFT]" <v-****@online.microsoft.comwrote in message
news:3T**************@TK2MSFTNGHUB02.phx.gbl...
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:
ms****@microsoft.com.

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


Jun 27 '08 #8
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.

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:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
Jun 27 '08 #9
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-****@online.microsoft.comwrote in message
news:lV**************@TK2MSFTNGHUB02.phx.gbl...
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.

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:
ms****@microsoft.com.

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


Jun 27 '08 #10
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!

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:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
Jun 27 '08 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
5
by: Charles | last post by:
Hello, I would like for my users to have a calendar control only when needed. IE button click for the control to appear and then once the date is selected. Populate a text box and the calendar...
7
by: Benny Raymond | last post by:
I searched for a couple hours lastnight on example code of how to go about making an item in the System Tray (notification area) not be square. I've found several programs that do this but I can't...
1
by: Linda Liu[MSFT] | last post by:
Hi George, Thank you for posting! This is a quick note to let you know that I am doing research on this issue and will get back to you ASAP. I appreciate your patience! Sincerely,
0
by: Chris Jobson | last post by:
>I have a sample similar to a previous post where I was binding a line end Not sure if I'm right, but I think the problem is that the data binding doesn't go through the property wrapper, but...
7
by: Linda Liu[MSFT] | last post by:
Hi George, I have downloaded your sample solution and built it on my machine. I got a compilation error indicating that the type of "CustomResources" doesn't exist in the following xaml code: ...
6
by: raylopez99 | last post by:
This language C# is more primitive than I thought. I just found out that C#2.0 does not support polyline (see below), a very useful feature for connecting points with a line automatically. Only...
2
by: Dean Slindee | last post by:
Is there any control in WPF which can host a WPF window? If not now, are there any plans to improve WPF to implement window hosting. Related question: is it not possible to build a MDI application...
0
by: TRoeschen | last post by:
I want to create a header that will appear on the top of each of my webpages that shows our company logo and location addresses. I first created a jpeg image that appears on the top of each page but...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.