Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Graphics Prof. Muhammad Saeed. Drawing and Transformation of Figures in C# August 1, 20122.

Similar presentations


Presentation on theme: "Computer Graphics Prof. Muhammad Saeed. Drawing and Transformation of Figures in C# August 1, 20122."— Presentation transcript:

1 Computer Graphics Prof. Muhammad Saeed

2 Drawing and Transformation of Figures in C# August 1, 20122

3 1. Basic Mathematics 1.Matrices i.Addition ii.Multiplication iii.Transpose iv. Inverse v.Algebraic Laws vi.Symmetry and Orthogonality 2.Geometry i.Coordinate systems ii. Introduction to 2D and 3D geometry iii.Basic trigonometric Formulae Transformation of Figures Computer Graphics August 1, 20123

4 2. Mathematics of Transformations 1.Rotation i.Rotation matrices for 2D and 3D systems ii.Homogeneous coordinates iii.Rotation around any axis Quaternions iv.Compound rotation, inverse rotation v.Orthogonality 2.Translation i.Translation matrices for 2D and 3D systems ii. Compound translations and rotations, inverse translation 3.Scaling i.Scaling matrix and its inverse ii.Compound scaling with other transformations Transformation of Figures Computer Graphics August 1, 20124

5 4.Reflection i.Reflection matrices for 2D in axes and lines ii.Reflection in planes iii.Inverse reflection 5.Inversion i.Through the origin for 2D and 3D systems ii. Inverse inversion 6.Shearing Shearing a 3D figure 7.Representing 3D on 2D Representation Transformation Transformation of Figures Computer Graphics August 1, 20125

6 3.Programming in C# ……….. 1.C# Introduction & GDI+ 2. Drawing Primitives i.Graphics class, color, pen, brush private void Form1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; Pen pen = new Pen(Color.Blue, sizeOfPen); //Pen pen = new Pen(Color.FromArgb(red, green, blue)); Brush brush = new SolidBrush(Color.FromArgb(red, green, blue)); Point point = new Point(); Brush brush1=Brushes.DarkSeaGreen; } public void userDefinedFunction() { Graphics g = CreateGraphics(); } Transformation of Figures Computer Graphics August 1, 20126

7 Transformation of Figures Computer Graphics ii.Line, circle, ellipse, rectangle, filled figures g.DrawLine(pen, x1,y1,x2,y2); g.DrawEllipse(pen, x1, y1, width, height); g.DrawRectangle(pen, x1, y1 width, height); g.FillEllipse(brush, x1, y1, width, height); iiiColor Common Dialog Box ColorDialog dlg = new ColorDialog(); dlg.FullOpen = true; Brush brush1; if (dlg.ShowDialog() == DialogResult.OK) { brush1 = new SolidBrush(dlg.Color); g.FillRectangle(brush1, x1, x2, width, height); } 3.Controls and Event Handling Menu Text Box, Label Button, Check Box, Radio Button Group Box Mouse & keyboard event handling August 1, 20127

8 4.Programming Transformations in C# i.2D graphics, rotation, translation, scaling, reflection, inversion and shearing ii.Representing 3D on 2D iii.3D transformations of a wireframe object such acube 5.Lines and curves i.parametric and implicit equations of lines, curves and conics in 2D and 3D systems. ( List given) ii.Bezier Curves and their properties 6.Morphing ( Tweening) i. introduction. ii. a simple 2D shape e.g. ‘H’ to a house drawing 7.Clipping i.Cohen-Sutherland Algorithm ii.Cyrus-Beck Algorithm Transformation of Figures Computer Graphics August 1, 20128

9 Transformation of Figures Computer Graphics 8. Advanced Features of C# i.A brief introduction to 2D transforms using System.Drawing.2D RotateTransform(angle) TranslateTransform(x-increment,y-increment) ScaleTransform(x-Factor, y-Factor) ResetTransform() ii.Image and Bitmap classes & Introduction To Image Processing Image image = Image.FromFile(“file Name”) g.DrawImage(image,x,y,image.Width, image.Height) image.Save(“File Name”, imageFormat) Bitmap bitmap = new Bitmap(“File Name”) bitmap = (Bitmap)Bitmap.FromFile(“File Name”) Color color = bitmap.GetPixel(x,y) bitmap.SetPixel(x,y,color) bitmap.Save (“File Name”, imageFormat) //ImageFormat.Png 9.Introducing Fractals i.Definition & Types ( slides )slides ii.Examples( Slides One, Two, Three )OneTwoThree August 1, 20129

10 The End Transformation of Figures Computer Graphics August 1, 201210


Download ppt "Computer Graphics Prof. Muhammad Saeed. Drawing and Transformation of Figures in C# August 1, 20122."

Similar presentations


Ads by Google