Download presentation
Presentation is loading. Please wait.
Published byLesley Stokes Modified over 8 years ago
1
(PART III) Graphics and Multimedia 16/02/1437 Lect6 CT1411 1
2
Outline Drawing Polygons and Polylines Advanced Graphics Capabilities 16/02/1437 Lect6 CT1411 2
3
Drawing Polygons and Polylines Polygons Multisided shapes Graphics methods used to draw polygons DrawLines, DrawPolygon, and FillPolygon 16/02/1437 Lect6 CT1411 3
4
Drawing Polygons and Polylines 16/02/1437 Lect6 CT1411 4
5
Example 16/02/1437 Lect6 CT1411 5
6
16/02/1437 Lect6 CT1411 6
7
Advanced Graphics Capabilities Visual Basic offers many additional graphics capabilities Examples Brush hierarchy also includes: HatchBrush, LinearGradientBrush, PathGradientBrush and TextureBrush Additional graphics features Dashed lines, thick lines, filling shapes with patterns, etc 16/02/1437 Lect6 CT1411 7
8
LinearGradientBrush LinearGradientBrush takes four arguments: Rectangle Two colors Constant from LinearGradientMode Examples Dim Rec1 As New Rectangle(5,5,25,20) Dim LGBrush As New LinearGradientBrush(Rec1, Color.White, Color.Blak, LinearGradientMode.ForwardDiagonal) 16/02/1437 Lect6 CT1411 8
9
TextureBrush TextureBrush is a brush that fills the interior of a shape with an image rather than a solid color. TextureBrush takes Bitmap object as an argument. 16/02/1437 Lect6 CT1411 9
10
TextureBrush Bitmap Class Produce images in color and gray scale with a particular width and height. Used to work with images defined by pixel data. How to use…. Dim graphicsObject As Graphics = e.Graphics Dim BitmapVar As Bitmap = New Bitmap(width, height). Dim BrushVar As TextureBrush = New TextureBrush(BitmapVar) graphicsObject.FillRectangle(BrushVar, X, Y, width, height) 16/02/1437 Lect6 CT1411 10
11
16/02/1437 Lect6 CT1411 11
12
16/02/1437 Lect6 CT1411 12
13
16/02/1437 Lect6 CT1411 13
14
Lect6 CT1411 16/02/1437 14
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.