Download presentation
1
Attributes of drawing elements
CS-321 4/25/2017 Attributes of drawing elements All drawn objects have attributes Color Line widths Fill These are often specified in a structure Windows: Device Context (DC) X: Graphics Context (GC) Abstracted in Qt by a QPainter Object See Abstracted in Java’s Swing classes by the Graphics object Dr. Mark L. Hornick
2
Color [see http://doc.trolltech.com/3.0/qcolor.html]
Specified by Red, Green, and Blue (usually 0-255) Great for hardware, poor for the user? Predefined color names (known by Qt) Predefined names for standard colors Mapped to RGB values (“Papaya whip”, “Peru”,…) Fall 2004 CS-321 Dr. Mark L. Hornick
3
Line Attributes [see http://doc.trolltech.com/3.0/qpen.html]
Width How many pixels wide is a line Draws rectangle or lines parallel to ideal line Style Solid, Dashed, etc. Line cap Line end Fall 2004 CS-321 Dr. Mark L. Hornick
4
Not all styles are supported by Qt.
Line Cap Styles [ Not last Line endpoint Butt Not all styles are supported by Qt. Round Projecting Fall 2004 CS-321 Dr. Mark L. Hornick
5
Line Join Styles [http://doc.trolltech.com/qt.html#PenJoinStyle-enum]
Bevel Miter Round Qt 3 supports all 3 styles. Fall 2004 CS-321 Dr. Mark L. Hornick
6
Polygon Attributes [see http://doc.trolltech.com/3.0/qbrush.html]
Filling Inside-Outside Rule Even-Odd Non-Zero Winding Number Solid Pattern Fall 2004 CS-321 Dr. Mark L. Hornick
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.