Attributes of drawing elements - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

Attributes of drawing elements

Description:

These are often specified in a structure. Windows: ... Not last. Butt. Round. Projecting. Line endpoint. 7. 7. 7. Fall 2004. CS-321. Dr. Mark L. Hornick. 7 ... – PowerPoint PPT presentation

Number of Views:59
Avg rating:3.0/5.0
Slides: 7
Provided by: ericd95
Category:

less

Transcript and Presenter's Notes

Title: Attributes of drawing elements


1
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 http//doc.trolltech.com/3.0/qpainter.html
  • Abstracted in Javas Swing classes by the
    Graphics object

2
Colorsee http//doc.trolltech.com/3.0/qcolor.htm
l
  • 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,)

3
Line Attributessee 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

4
Line Cap Styles http//doc.trolltech.com/3.0/qt.h
tmlPenCapStyle-enum
Not last
Line endpoint
Butt
Not all styles are supported by Qt.
Round
Projecting
5
Line Join Styleshttp//doc.trolltech.com/qt.html
PenJoinStyle-enum
Bevel
Round
Miter
Qt 3 supports all 3 styles.
6
Polygon Attributessee http//doc.trolltech.com/3
.0/qbrush.html
  • Filling
  • Inside-Outside Rule
  • Even-Odd
  • Non-Zero Winding Number
  • Solid
  • Pattern
Write a Comment
User Comments (0)
About PowerShow.com