Microsoft Blend - drawing polygons - wpf

I recently downloaded trial version of Microsoft Expression Blend and I can't figure out how I can draw polygons. I only found predefined shapes like pentagon,octagon, triangles but I can't find a tool to draw polygon

Use the Pen tool. See http://expression.microsoft.com/en-us/cc188984.aspx for a video tutorial.

In Expresion Blend 4:
Place a any RegularPolygon shape such as a triangle, pentagon, or Hexagon on your canvas.
Go to the Properties Panel and expand the Appearance section.
Change the point count to the number of sides you want. 8 for Octagon, etc.

Related

WPF blurry vector icons

I'm not able to get crisp icons in a WPF project. I've tried several solutions but the results are terrible when the icons are downscaled. The starting files are .ai (Illustrator) that I've exported to xaml code using Expression Design
Here is an example
blurry icons example
First of all, you can try to play with properties SnapsToDevicePixels and UseLayoutRounding.
Next, please check what coordinates your vector images use. In order to get the sharp lines, you must either move your coordinate system to (0.5, 0.5) or use half-integer coordinates (e.g. 0.5, 2.5, 11.5).
Please, have a look at this MSDN topic.
There is also a perfect article on this topic. It's in Russian, but you can try to use Google Translate for it.

How to draw a vertical line graph on WPF?

I am learning to draw a line graph inside my WPF. i found a tutorial of a horizontal line graph at this side " http://www.c-sharpcorner.com/uploadfile/mahesh/line-chart-in-wpf/ " and i manage to do it. But my question is how to draw a vertical graph?
I taking the example of the graph from the website i provided, if transform the graph to the vertical graph. The X-axis will be the int(on the top) and the Y-axis will be the Date(at the left hand side). Anyone can help me out?
The graph i want should be like this:
http://imageshack.us/photo/my-images/202/capturegfj.jpg/
p/s : sorry, i couldn't upload an image due to low reputation point.
Thanks
You can use Microsoft provided chart controls:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datavisualization.charting.chart.aspx
The SeriesChartType.Line is your chart type I guess.
Here is a sample on MSDN. http://msdn.microsoft.com/en-us/library/hh297122%28v=vs.100%29.aspx

WPF 3D transparent textures - clipping?

http://www.youtube.com/watch?v=gZNdfVwkttM - you can see all of the problem described on this video if you can't see pictures.
All of walls in all images below have a semitransparent PNG texture. Each square wall, floor and ceiling tile is a separate GeometryModel3D (I know that is no good for performance but...). The floor and the ceiling of the central cube have no any geometry and textures - so they have a color the same as Window.Background (black). But the effect considered appears in any way of transparency obtaining: texture for ImageBrush with transparency, Material.Color (for example DiffuseMAterial.Color) where Color has alpha channel, ImageBrush as material where ImageBrush has Opacity - all the way I have the same problem.
All of walls consists of two triangles. Where are no explicit normals , because I define triangle indices so normals culculated automatically by WPF.
http://imagepost.ru/images/i/ma/image00001.png
It also haven't any back material or extra triangles from the back side.
As you can see there is no problem if you look only from +Z to -Z (standing on the blue square and looking to the red square - that is the second picture).
But if you look backward (from red to blue - the first picture) there is no transparency!
Well, I desided to look from the yellow square (third picture).
And then I walked nearer - you can see what was happening (pictures from 4 to 6).
There are no geometry construction error or texture mapping error or lighting error! It is some kind of clipping, I guessed! In addition there are some interested pictures 7 and 8 to prove my guess.
The last picture shows the white background of the window that hosted Viewport3D (previous was black), and my guess about clipping confirmed - WPF just not painted this part of the scene and we can see the window background!
BUT! If this happens from various looks, why the look from +Z to -Z (second picture) seems well?!
You need to sort the triangles based on their distances from the viewpoint. Only then, wpf will be able to blend the transparent textures.
DirectX is able to blend triangles on top of each other but only when drawing them back to front
http://www.ericsink.com/wpf3d/2_Transparency.html

Expression Blend 4 and Curved Text

I'm looking to create text follow a curved arch. How can I go about this using Expression Blend 4?
A comprehensive walk through is available on electric beach

Rectangle animation examples

Are there any examples on the internet of silverlight animation which can do the following:
A rectangle zooming in
A rectangle going down from a certain position on the x axis to a certain position on the x axis
I looked on silverlight.net but couldn't find these examples (which are quite rudimentary). Anyone know where I can see an example with source for this?
Thanks
Do a ScaleTransform for the zooming effect and Translate transform for the move effect. I am sure you can find out lot of examples in a search for "Silverlight Animation". It doesnt matter it is rectangle or any other UIElement
http://www.wynapse.com/Silverlight/Tutor/Clipping_Silverlight_Animated_Rectangles.aspx
http://www.developerfusion.com/article/7303/have-you-seen-the-silverlight-more-silverlight/2/

Resources