Download presentation
Presentation is loading. Please wait.
Published byPaulina Greene Modified over 8 years ago
1
(PART II) Graphics and Multimedia 11/02/1437 Lect6 (Part 2) 1411 1
2
Font Control Font s After a Font is created, its properties cannot be modified Programmers must create a new Font object to be different Font constructors Must require a font name as an argument They usually require the font size as an argument And usually require the font style which is a member of the FontStyle enumeration: Bold, Italic, Regular, Strikeout, Underline. Graphics method DrawString sets the current drawing font—the font in which the text displays—to its Font argument. 11/02/1437 Lect6 (Part 2) 1411 2
3
Font Control DrawString constructors: String to display Font, Brush and the x- and y-coordinates of the location for the String’s first character. Example Dim textbrush As New SolidBrush(Color.Red) g.DrawString("Hello World", Me.Font, textbrush, 10, 10) 11/02/1437 Lect6 (Part 2) 1411 3
4
11/02/1437 Lect6 (Part 2) 1411 4
5
Example 11/02/1437 Lect6 (Part 2) 1411 5
6
11/02/1437 Lect6 (Part 2) 1411 6
7
11/02/1437 Lect6 (Part 2) 1411 7
8
Drawing Lines, Rectangles and Ovals Example: DrawRectangle(ByVal p As Pen, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer) FillRectangle(ByVal b As Brush, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer) Draw ShapeShape Outline Pen Solid Shape Brush 11/02/1437 Lect6 (Part 2) 1411 8
9
11/02/1437 Lect6 (Part 2) 1411 9
10
Drawing Lines, Rectangles and Ovals Ellipse bounded by a rectangle. height width (x, y) 11/02/1437 Lect6 (Part 2) 1411 10
11
Example 11/02/1437 Lect6 (Part 2) 1411 11
12
11/02/1437 Lect6 (Part 2) 1411 12
13
11/02/1437 Lect6 (Part 2) 1411 13
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.