Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
×

# Wpf Workgroup 3

2,394 views

Published on

The third WPF workgroup at FCS, UAIC

• Full Name
Comment goes here.

Are you sure you want to Yes No
Your message goes here
• Be the first to comment

• Be the first to like this

### Wpf Workgroup 3

1. 1. Andrei Iacob Microsoft Student Partners
2. 2. Agenda <ul><li>Intro </li></ul><ul><li>2D - Clasa Shape - Linii - alte forme primitive geometrice - Brushes & pens - Path , “geometrii” şi mini-limbajul său - Transform ări </li></ul><ul><li>XAML exploitation </li></ul>
3. 3. Intro <ul><li>XAMLPad </li></ul><ul><li>Cuvinte cheie: SVG, Media Integration Layer, FrameworkElement (UIElement), GDI+ </li></ul>
4. 4. Ierarhia <ul><li>UIElement - FrameworkElement - Shape (abstract) - Ellipse - Line - Path - Polygon - Polyline - Rectangle </li></ul>
5. 5. Lin e <ul><li>Propriet ăţi: - X1, Y1, X2, Y2 – Double </li></ul><ul><li>- Stroke - Brush </li></ul>
6. 6. Rectangle <ul><li>Proprietăţi - Width, Height – Double - Fill, Stroke – Brush - RadiusX, RadiusY – Double </li></ul>
7. 7. Ellipse <ul><li>Proprietăţi - Width, Height – Double - Fill, Stroke – Brush </li></ul>
8. 8. Polyline <ul><li>Proprietăţi - Points – PointCollection - Stroke, Fill – Brush </li></ul><ul><li>Exemplu: </li></ul><ul><li><Polyline Stroke=&quot;Blue” Points=&quot;0,80 60,80 65,50 68,110 73,80 85,80 90,50 93,110 98,80 210,80&quot; /> </li></ul>
9. 9. Polyline <ul><li>O spiral ă poly=new Polyline(); poly.Stroke = SystemColors.WindowTextBrush; </li></ul><ul><li>Panza.Children.Add(poly); </li></ul><ul><li>Point[] pts=new Point[numpts]; </li></ul><ul><li>for (int i=0;i<numpts;i++) </li></ul><ul><li>{ </li></ul><ul><li>double angle = i * 2 * Math.PI / (numpts/revs); </li></ul><ul><li>double scale = 250 * ( 1 - (double)i/numpts); </li></ul><ul><li>pts[i].X = scale * Math.Cos(angle); </li></ul><ul><li>pts[i].Y = scale * Math.Sin(angle); </li></ul><ul><li>} </li></ul><ul><li>poly.Points = new PointCollection(pts); </li></ul>
10. 10. Polygon <ul><li>Proprietăţi - Points – PointCollection - Stroke, Fill – Brush </li></ul><ul><li>Exemplu: </li></ul><ul><li><Poly gon Stroke=&quot;Blue” Points=&quot;0,80 60,80 65,50 68,110 73,80 85,80 90,50 93,110 98,80 210,80&quot; /> </li></ul>
11. 11. Brush <ul><li>Culori în WPF - 4 canale: Red, Green, Blue, Alpha - 16 biţi /culoare </li></ul><ul><li>SolidColorBrush </li></ul>