Class: Fox::FXDC
- Inherits:
-
Object
- Object
- Fox::FXDC
- Defined in:
- rdoc-sources/FXDC.rb,
lib/fox16/core.rb
Overview
A device context is used to maintain the state of the graphics drawing system. Defining your drawing code in terms of the Abstract Device Context allows the drawing commands to be rendered on different types of surfaces, such as windows and images (FXDCWindow), or on paper (FXDCPrint). WYSYWYG may be obtained by using the same identical drawing code in your application regardless of the actual device surface being utilized.
Drawing (BITBLT) functions
BLT_CLR
-
D := 0
BLT_SRC_AND_DST
-
D := S & D
BLT_SRC_AND_NOT_DST
-
D := S & ~D
BLT_SRC
-
D := S
BLT_NOT_SRC_AND_DST
-
D := ~S & D
BLT_DST
-
D := D
BLT_SRC_XOR_DST
-
D := S ^ D
BLT_SRC_OR_DST
-
D := S | D
BLT_NOT_SRC_AND_NOT_DST
-
D := ~S & ~D == D := ~(S | D)
BLT_NOT_SRC_XOR_DST
-
D := ~S ^ D
BLT_NOT_DST
-
D := ~D
BLT_SRC_OR_NOT_DST
-
D := S | ~D
BLT_NOT_SRC
-
D := ~S
BLT_NOT_SRC_OR_DST
-
D := ~S | D
BLT_NOT_SRC_OR_NOT_DST
-
D := ~S | ~D == ~(S & D)
BLT_SET
-
D := 1
Line Styles
LINE_SOLID
-
Solid lines
LINE_ONOFF_DASH
-
On-off dashed lines
LINE_DOUBLE_DASH
-
Double dashed lines
Line Cap Styles
CAP_NOT_LAST
-
Don’t include last end cap
CAP_BUTT
-
Butting line end caps
CAP_ROUND
-
Round line end caps
CAP_PROJECTING
-
Projecting line end caps
Line Join Styles
JOIN_MITER
-
Mitered or pointy joints
JOIN_ROUND
-
Round line joints
JOIN_BEVEL
-
Beveled or flat joints
Fill Styles
FILL_SOLID
-
Fill with solid color
FILL_TILED
-
Fill with tiled bitmap
FILL_STIPPLED
-
Fill where stipple mask is 1
FILL_OPAQUESTIPPLED
-
Fill with foreground where mask is 1, background otherwise
Fill Rules
RULE_EVEN_ODD
-
Even odd polygon filling
RULE_WINDING
-
Winding rule polygon filling
Stipple/dither patterns
STIPPLE_0
-
Stipple pattern 0
STIPPLE_NONE
-
Stipple pattern 0
STIPPLE_BLACK
-
All ones
STIPPLE_1
-
Stipple pattern 1
STIPPLE_2
-
Stipple pattern 2
STIPPLE_3
-
Stipple pattern 3
STIPPLE_4
-
Stipple pattern 4
STIPPLE_5
-
Stipple pattern 5
STIPPLE_6
-
Stipple pattern 6
STIPPLE_7
-
Stipple pattern 7
STIPPLE_8
-
Stipple pattern 8
STIPPLE_GRAY
-
50% gray
STIPPLE_9
-
Stipple pattern 9
STIPPLE_10
-
Stipple pattern 10
STIPPLE_11
-
Stipple pattern 11
STIPPLE_12
-
Stipple pattern 12
STIPPLE_13
-
Stipple pattern 13
STIPPLE_14
-
Stipple pattern 14
STIPPLE_15
-
Stipple pattern 15
STIPPLE_16
-
Stipple pattern 16
STIPPLE_WHITE
-
All zeroes
STIPPLE_HORZ
-
Horizontal hatch pattern
STIPPLE_VERT
-
Vertical hatch pattern
STIPPLE_CROSS
-
Cross-hatch pattern
STIPPLE_DIAG
-
Diagonal // hatch pattern
STIPPLE_REVDIAG
-
Reverse diagonal \ hatch pattern
STIPPLE_CROSSDIAG
-
Cross-diagonal hatch pattern
Direct Known Subclasses
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Application FXApp.
-
#background ⇒ Object
Background drawing color FXColor.
-
#clipHeight ⇒ Object
readonly
Height of clip rectangle, in pixels [Integer].
-
#clipRectangle ⇒ Object
readonly
Clip rectangle FXRectangle.
-
#clipRegion ⇒ Object
writeonly
Clip region FXRegion.
-
#clipWidth ⇒ Object
readonly
Width of clip rectangle, in pixels [Integer].
-
#clipX ⇒ Object
readonly
X-coordinate of clip rectangle [Integer].
-
#clipY ⇒ Object
readonly
Y-coordinate of clip rectangle [Integer].
-
#dashLength ⇒ Object
readonly
Dash length [Integer].
-
#dashOffset ⇒ Object
readonly
Dash offset [Integer].
-
#dashPattern ⇒ Object
readonly
Dash pattern [String].
-
#fillRule ⇒ Object
Fill rule, one of
RULE_EVEN_ODD
orRULE_WINDING
[Integer]. -
#fillStyle ⇒ Object
Fill style, one of
FILL_SOLID
,FILL_TILED
,FILL_STIPPLED
orFILL_OPAQUESTIPPLED
[Integer]. -
#font ⇒ Object
Font to draw text with FXFont.
-
#foreground ⇒ Object
Foreground drawing color FXColor.
-
#function ⇒ Object
Raster op function, one of
BLT_CLR
,BLT_SRC
,BLT_DST
, etc. -
#lineCap ⇒ Object
Line cap style, one of
CAP_NOT_LAST
,CAP_BUTT
,CAP_ROUND
orCAP_PROJECTING
[Integer]. -
#lineJoin ⇒ Object
Line join style, one of
JOIN_MITER
,JOIN_ROUND
orJOIN_BEVEL
[Integer]. -
#lineStyle ⇒ Object
Line style, one of
LINE_SOLID
,LINE_ONOFF_DASH
orLINE_DOUBLE_DASH
[Integer]. -
#lineWidth ⇒ Object
Line width; a line width of zero means thinnest and fastest possible [Integer].
-
#stipple ⇒ Object
Stipple pattern [FXBitmap or Integer].
-
#tile ⇒ Object
Tile image FXImage.
Instance Method Summary collapse
-
#clearClipMask ⇒ Object
Clear clip mask.
-
#clearClipRectangle ⇒ Object
Clear clipping.
-
#clipChildren(yes) ⇒ Object
When you call #clipChildren with the argument
true
, anything that you draw into this window will be clipped by its child windows. -
#drawArc(x, y, w, h, start, extent) ⇒ Object
Draw an arc.
-
#drawArcs(arcs) ⇒ Object
Draw arcs, where arcs is an array of FXArc instances.
-
#drawArea(source, sx, sy, sw, sh, dx, dy, dw, dh) ⇒ Object
Copy some rectangular area from source into the drawable attached to this device context, stretching it to width dw and height dh.
-
#drawBitmap(bitmap, dx, dy) ⇒ Object
Draw bitmap into the drawable attached to this device context.
-
#drawCircle(x, y, r) ⇒ Object
Draw a circle centered at (x, y), with specified radius.
-
#drawEllipse(x, y, w, h) ⇒ Object
Draw an ellipse.
-
#drawFocusRectangle(x, y, w, h) ⇒ Object
Draw focus rectangle with upper-left corner at (x, y) and with width and height (w, h).
-
#drawHashBox(x, y, w, h, b = 1) ⇒ Object
Draw hashed box with upper-left corner at (x, y) and with width and height (w, h).
-
#drawIcon(icon, dx, dy) ⇒ Object
Draw icon into the drawable attached to this device context.
-
#drawIconShaded(icon, dx, dy) ⇒ Object
Draw a shaded version of an icon into the drawable attached to this device context.
-
#drawIconSunken(icon, dx, dy) ⇒ Object
Draw a sunken version of an icon into the drawable attached to this device context.
-
#drawImage(image, dx, dy) ⇒ Object
Draw image into the drawable attached to this device context.
-
#drawImageText(x, y, string) ⇒ Object
Draw string at position (x, y).
-
#drawLine(x1, y1, x2, y2) ⇒ Object
Draw the line from (x1, y1) to (x2, y2).
-
#drawLines(points) ⇒ Object
Draw connected lines, where points is an array of FXPoint instances.
-
#drawLineSegments(segments) ⇒ Object
Draw mutiple, unconnected lines (i.e. line segments), where segments is an array of FXSegment instances.
-
#drawLinesRel(points) ⇒ Object
Draw connected lines, where points is an array of FXPoint instances.
-
#drawPoint(x, y) ⇒ Object
Draw a point at (x, y) in the current foreground drawing color.
-
#drawPoints(points) ⇒ Object
Draw multiple points, where points is an array of FXPoint instances.
-
#drawPointsRel(points) ⇒ Object
Draw multiple points, where points is an array of FXPoint instances.
-
#drawRectangle(x, y, w, h) ⇒ Object
Draw rectangle with upper-left corner at (x, y) and with width and height (w, h).
-
#drawRectangles(rectangles) ⇒ Object
Draw multiple rectangles, where rectangles is an array of FXRectangle instances.
-
#drawRoundRectangle(x, y, w, h, ew, eh) ⇒ Object
Draw a rounded rectangle with ellipse width ew and ellipse height eh.
-
#drawText(x, y, string) ⇒ Object
Draw string at position (x, y).
-
#fillArc(x, y, w, h, start, extent) ⇒ Object
Draw filled arc (see documentation for #drawArc).
-
#fillArcs(arcs) ⇒ Object
Draw filled arcs, where arcs is an array of FXArc instances.
- #fillChord(x, y, w, h, ang1, ang2) ⇒ Object
- #fillChords(chords, nchords) ⇒ Object
-
#fillCircle(x, y, r) ⇒ Object
Draw a filled circle centered at (x, y), with specified radius.
-
#fillComplexPolygon(points) ⇒ Object
Draw filled polygon, where points is an array of FXPoint instances.
-
#fillComplexPolygonRel(points) ⇒ Object
Draw filled polygon with relative points, where points is an array of FXPoint instances.
-
#fillConcavePolygon(points) ⇒ Object
Draw filled polygon, where points is an array of FXPoint instances.
-
#fillConcavePolygonRel(points) ⇒ Object
Draw filled polygon with relative points, where points is an array of FXPoint instances.
-
#fillEllipse(x, y, w, h) ⇒ Object
Draw a filled ellipse.
-
#fillPolygon(points) ⇒ Object
Draw filled polygon, where points is an array of FXPoint instances.
-
#fillPolygonRel(points) ⇒ Object
Draw filled polygon with relative points, where points is an array of FXPoint instances.
-
#fillRectangle(x, y, w, h) ⇒ Object
Draw filled rectangle with upper-left corner at (x, y) and with width and height (w, h).
-
#fillRectangles(rectangles) ⇒ Object
Draw filled rectangles, where rectangles is an array of FXRectangle instances.
-
#fillRoundRectangle(x, y, w, h, ew, eh) ⇒ Object
Draw a filled rounded rectangle with ellipse width ew and ellipse height eh.
-
#initialize(app) ⇒ FXDC
constructor
Construct dummy DC.
-
#readPixel(x, y) ⇒ Object
Returns a color value (i.e. an FXColor) for the pixel at (x, y).
-
#setClipMask(bitmap, dx = 0, dy = 0) ⇒ Object
Set clip mask to bitmap.
-
#setClipRectangle(rectangle) ⇒ Object
Set clip rectangle.
-
#setDashes(dashOffset, dashPattern) ⇒ Object
Set dash pattern and dash offset.
Constructor Details
#initialize(app) ⇒ FXDC
Construct dummy DC
199 |
# File 'rdoc-sources/FXDC.rb', line 199 def initialize(app) ; end |
Instance Attribute Details
#app ⇒ Object (readonly)
Application Fox::FXApp
133 134 135 |
# File 'rdoc-sources/FXDC.rb', line 133 def app @app end |
#background ⇒ Object
Background drawing color Fox::FXColor
139 140 141 |
# File 'rdoc-sources/FXDC.rb', line 139 def background @background end |
#clipHeight ⇒ Object (readonly)
Height of clip rectangle, in pixels [Integer]
193 194 195 |
# File 'rdoc-sources/FXDC.rb', line 193 def clipHeight @clipHeight end |
#clipRectangle ⇒ Object (readonly)
Clip rectangle Fox::FXRectangle
181 182 183 |
# File 'rdoc-sources/FXDC.rb', line 181 def clipRectangle @clipRectangle end |
#clipRegion=(value) ⇒ Object (writeonly)
Clip region Fox::FXRegion
178 179 180 |
# File 'rdoc-sources/FXDC.rb', line 178 def clipRegion=(value) @clipRegion = value end |
#clipWidth ⇒ Object (readonly)
Width of clip rectangle, in pixels [Integer]
190 191 192 |
# File 'rdoc-sources/FXDC.rb', line 190 def clipWidth @clipWidth end |
#clipX ⇒ Object (readonly)
X-coordinate of clip rectangle [Integer]
184 185 186 |
# File 'rdoc-sources/FXDC.rb', line 184 def clipX @clipX end |
#clipY ⇒ Object (readonly)
Y-coordinate of clip rectangle [Integer]
187 188 189 |
# File 'rdoc-sources/FXDC.rb', line 187 def clipY @clipY end |
#dashLength ⇒ Object (readonly)
Dash length [Integer]
148 149 150 |
# File 'rdoc-sources/FXDC.rb', line 148 def dashLength @dashLength end |
#dashOffset ⇒ Object (readonly)
Dash offset [Integer]
145 146 147 |
# File 'rdoc-sources/FXDC.rb', line 145 def dashOffset @dashOffset end |
#dashPattern ⇒ Object (readonly)
Dash pattern [String]
142 143 144 |
# File 'rdoc-sources/FXDC.rb', line 142 def dashPattern @dashPattern end |
#fillRule ⇒ Object
Fill rule, one of RULE_EVEN_ODD
or RULE_WINDING
[Integer]
166 167 168 |
# File 'rdoc-sources/FXDC.rb', line 166 def fillRule @fillRule end |
#fillStyle ⇒ Object
Fill style, one of FILL_SOLID
, FILL_TILED
, FILL_STIPPLED
or FILL_OPAQUESTIPPLED
[Integer]
163 164 165 |
# File 'rdoc-sources/FXDC.rb', line 163 def fillStyle @fillStyle end |
#font ⇒ Object
Font to draw text with Fox::FXFont
196 197 198 |
# File 'rdoc-sources/FXDC.rb', line 196 def font @font end |
#foreground ⇒ Object
Foreground drawing color Fox::FXColor
136 137 138 |
# File 'rdoc-sources/FXDC.rb', line 136 def foreground @foreground end |
#function ⇒ Object
Raster op function, one of BLT_CLR
, BLT_SRC
, BLT_DST
, etc. (see list above) [Integer]
169 170 171 |
# File 'rdoc-sources/FXDC.rb', line 169 def function @function end |
#lineCap ⇒ Object
Line cap style, one of CAP_NOT_LAST
, CAP_BUTT
, CAP_ROUND
or CAP_PROJECTING
[Integer]
154 155 156 |
# File 'rdoc-sources/FXDC.rb', line 154 def lineCap @lineCap end |
#lineJoin ⇒ Object
Line join style, one of JOIN_MITER
, JOIN_ROUND
or JOIN_BEVEL
[Integer]
157 158 159 |
# File 'rdoc-sources/FXDC.rb', line 157 def lineJoin @lineJoin end |
#lineStyle ⇒ Object
Line style, one of LINE_SOLID
, LINE_ONOFF_DASH
or LINE_DOUBLE_DASH
[Integer]
160 161 162 |
# File 'rdoc-sources/FXDC.rb', line 160 def lineStyle @lineStyle end |
#lineWidth ⇒ Object
Line width; a line width of zero means thinnest and fastest possible [Integer]
151 152 153 |
# File 'rdoc-sources/FXDC.rb', line 151 def lineWidth @lineWidth end |
#stipple ⇒ Object
Stipple pattern [FXBitmap or Integer]
175 176 177 |
# File 'rdoc-sources/FXDC.rb', line 175 def stipple @stipple end |
#tile ⇒ Object
Tile image Fox::FXImage
172 173 174 |
# File 'rdoc-sources/FXDC.rb', line 172 def tile @tile end |
Instance Method Details
#clearClipMask ⇒ Object
Clear clip mask.
703 |
# File 'rdoc-sources/FXDC.rb', line 703 def clearClipMask() ; end |
#clearClipRectangle ⇒ Object
Clear clipping.
685 |
# File 'rdoc-sources/FXDC.rb', line 685 def clearClipRectangle() ; end |
#clipChildren(yes) ⇒ Object
When you call #clipChildren with the argument true
, anything that you draw into this window will be clipped by its child windows. In other words, the child windows “obscure” the parent window. This is the default behavior. If you call #clipChildren with false
, anything that you draw into this window will be visible in its child windows (i.e. the drawing will not be clipped).
Parameters:
yes
-
if
true
, drawing is clipped against child windows [Boolean]
717 |
# File 'rdoc-sources/FXDC.rb', line 717 def clipChildren(yes) ; end |
#drawArc(x, y, w, h, start, extent) ⇒ Object
Draw an arc. The argument start specifies the start of the arc relative to the three-o’clock position from the center, in units of degrees*64. The argument extent specifies the path and extent of the arc, relative to the start of the arc (also in units of degrees*64). The arguments x, y, w, and h specify the bounding rectangle of the arc.
Parameters:
x
-
x-coordinate of the upper left corner of the bounding rectangle [Integer]
y
-
y-coordinate of the upper left corner of the bounding rectangle [Integer]
w
-
width of the bounding rectangle, in pixels [Integer]
h
-
height of the bounding rectangle, in pixels [Integer]
start
-
starting angle of the arc, in 64ths of a degree [Integer]
extent
-
the path and extent of the arc, relative to the start of the arc (in 64ths of a degree) [Integer]
358 |
# File 'rdoc-sources/FXDC.rb', line 358 def drawArc(x, y, w, h, start, extent) ; end |
#drawArcs(arcs) ⇒ Object
369 |
# File 'rdoc-sources/FXDC.rb', line 369 def drawArcs(arcs) ; end |
#drawArea(source, sx, sy, sw, sh, dx, dy, dw, dh) ⇒ Object
Copy some rectangular area from source into the drawable attached to this device context, stretching it to width dw and height dh.
Parameters:
source
-
the source drawable from which to copy Fox::FXDrawable
sx
-
x-coordinate of the upper left corner of the source rectangle [Integer]
sy
-
y-coordinate of the upper left corner of the source rectangle [Integer]
sw
-
width of the source rectangle, in pixels [Integer]
sh
-
height of the source rectangle, in pixels [Integer]
dx
-
x-coordinate of the the destination point in this drawable [Integer]
dy
-
y-coordinate of the the destination point in this drawable [Integer]
dw
-
destination width, in pixels [Integer]
dh
-
destination height, in pixels [Integer]
541 |
# File 'rdoc-sources/FXDC.rb', line 541 def drawArea(source, sx, sy, sw, sh, dx, dy) ; end |
#drawBitmap(bitmap, dx, dy) ⇒ Object
Draw bitmap into the drawable attached to this device context.
Parameters:
bitmap
-
bitmap to draw Fox::FXBitmap
dx
-
x-coordinate of the the destination point in this drawable [Integer]
dy
-
y-coordinate of the the destination point in this drawable [Integer]
581 |
# File 'rdoc-sources/FXDC.rb', line 581 def drawBitmap(bitmap, dx, dy) ; end |
#drawCircle(x, y, r) ⇒ Object
Draw a circle centered at (x, y), with specified radius.
Parameters:
x
:: x-coordinate of the circle’s center [Integer] y
:: y-coordinate of the circle’s center [Integer] r
:: radius of the circle, in pixels [Integer]
See also #fillCircle.
608 609 610 |
# File 'lib/fox16/core.rb', line 608 def drawCircle(x, y, r) drawArc(x-r, y-r, 2*r, 2*r, 0, 360*64) end |
#drawEllipse(x, y, w, h) ⇒ Object
Draw an ellipse.
374 |
# File 'rdoc-sources/FXDC.rb', line 374 def drawEllipse(x, y, w, h); end |
#drawFocusRectangle(x, y, w, h) ⇒ Object
Draw focus rectangle with upper-left corner at (x, y) and with width and height (w, h).
Parameters:
x
-
x-coordinate of the upper left corner [Integer]
y
-
y-coordinate of the upper left corner [Integer]
width
-
width of the rectangle, in pixels [Integer]
height
-
height of the rectangle, in pixels [Integer]
525 |
# File 'rdoc-sources/FXDC.rb', line 525 def drawFocusRectangle(x, y, w, h) ; end |
#drawHashBox(x, y, w, h, b = 1) ⇒ Object
Draw hashed box with upper-left corner at (x, y) and with width and height (w, h).
Parameters:
x
-
x-coordinate of the upper left corner [Integer]
y
-
y-coordinate of the upper left corner [Integer]
width
-
width of the box, in pixels [Integer]
height
-
height of the box, in pixels [Integer]
b
-
border width, in pixels [Integer]
513 |
# File 'rdoc-sources/FXDC.rb', line 513 def drawHashBox(x, y, w, h, b=1) ; end |
#drawIcon(icon, dx, dy) ⇒ Object
Draw icon into the drawable attached to this device context.
Parameters:
icon
-
icon to draw Fox::FXIcon
dx
-
x-coordinate of the the destination point in this drawable [Integer]
dy
-
y-coordinate of the the destination point in this drawable [Integer]
592 |
# File 'rdoc-sources/FXDC.rb', line 592 def drawIcon(icon, dx, dy) ; end |
#drawIconShaded(icon, dx, dy) ⇒ Object
Draw a shaded version of an icon into the drawable attached to this device context. This is typically used for drawing disabled labels and buttons.
Parameters:
icon
-
icon to draw Fox::FXIcon
dx
-
x-coordinate of the the destination point in this drawable [Integer]
dy
-
y-coordinate of the the destination point in this drawable [Integer]
604 |
# File 'rdoc-sources/FXDC.rb', line 604 def drawIconShaded(icon, dx, dy) ; end |
#drawIconSunken(icon, dx, dy) ⇒ Object
Draw a sunken version of an icon into the drawable attached to this device context.
Parameters:
icon
-
icon to draw Fox::FXIcon
dx
-
x-coordinate of the the destination point in this drawable [Integer]
dy
-
y-coordinate of the the destination point in this drawable [Integer]
615 |
# File 'rdoc-sources/FXDC.rb', line 615 def drawIconSunken(icon, dx, dy) ; end |
#drawImage(image, dx, dy) ⇒ Object
Draw image into the drawable attached to this device context.
Parameters:
image
-
image to draw Fox::FXImage
dx
-
x-coordinate of the the destination point in this drawable [Integer]
dy
-
y-coordinate of the the destination point in this drawable [Integer]
570 |
# File 'rdoc-sources/FXDC.rb', line 570 def drawImage(image, dx, dy) ; end |
#drawImageText(x, y, string) ⇒ Object
Draw string at position (x, y).
Parameters:
x
-
x-coordinate of the upper left corner [Integer]
y
-
y-coordinate of the upper left corner [Integer]
string
-
the text string to draw [String]
See also #drawText.
641 |
# File 'rdoc-sources/FXDC.rb', line 641 def drawImageText(x, y, string) ; end |
#drawLine(x1, y1, x2, y2) ⇒ Object
Draw the line from (x1, y1) to (x2, y2).
Parameters:
x1
-
x-coordinate of the starting point [Integer]
y1
-
y-coordinate of the starting point [Integer]
x2
-
x-coordinate of the ending point [Integer]
y2
-
y-coordinate of the ending point [Integer]
See also #drawLines and #drawLinesRel.
260 |
# File 'rdoc-sources/FXDC.rb', line 260 def drawLine(x1, y1, x2, y2) ; end |
#drawLines(points) ⇒ Object
Draw connected lines, where points is an array of FXPoint instances. The number of lines drawn is equal to the size of the points array minus one. Treats all points’ coordinates as relative to the origin.
Parameters:
points
-
array of FXPoint instances that defines all points on the line [Array]
See also #drawLine and #drawLinesRel.
274 |
# File 'rdoc-sources/FXDC.rb', line 274 def drawLines(points) ; end |
#drawLineSegments(segments) ⇒ Object
Draw mutiple, unconnected lines (i.e. line segments), where segments is an array of FXSegment instances.
Parameters:
segments
-
an array of FXSegment instances [Array]
299 |
# File 'rdoc-sources/FXDC.rb', line 299 def drawLineSegments(segments) ; end |
#drawLinesRel(points) ⇒ Object
Draw connected lines, where points is an array of FXPoint instances. The number of lines drawn is equal to the size of the points array minus one. Treats each point’s coordinates (after the first) as relative to the previous point.
Parameters:
points
-
array of FXPoint instances that defines all points on the line [Array]
See also #drawLine and #drawLines.
289 |
# File 'rdoc-sources/FXDC.rb', line 289 def drawLinesRel(points) ; end |
#drawPoint(x, y) ⇒ Object
Draw a point at (x, y) in the current foreground drawing color.
Parameters:
x
-
x-coordinate of the point [Integer]
y
-
y-coordinate of the point [Integer]
See also #drawPoints and #drawPointsRel.
221 |
# File 'rdoc-sources/FXDC.rb', line 221 def drawPoint(x, y) ; end |
#drawPoints(points) ⇒ Object
Draw multiple points, where points is an array of FXPoint instances.
Parameters:
points
-
array of FXPoint instances [Array]
See also #drawPoint and #drawPointsRel.
232 |
# File 'rdoc-sources/FXDC.rb', line 232 def drawPoints(points) ; end |
#drawPointsRel(points) ⇒ Object
Draw multiple points, where points is an array of FXPoint instances. Unlike #drawPoints, where each of the points is drawn relative to the origin, #drawPointsRel treats all coordinates after the first as relative to the previous point.
Parameters:
points
-
array of FXPoint instances [Array]
See also #drawPoint and #drawPoints.
246 |
# File 'rdoc-sources/FXDC.rb', line 246 def drawPointsRel(points) ; end |
#drawRectangle(x, y, w, h) ⇒ Object
Draw rectangle with upper-left corner at (x, y) and with width and height (w, h).
Parameters:
x
-
x-coordinate of upper-left corner of the rectangle [Integer]
y
-
y-coordinate of upper-left corner of the rectangle [Integer]
width
-
width of the rectangle, in pixels [Integer]
height
-
height of the rectangle, in pixels [Integer]
See also #drawRectangles, #fillRectangle and #fillRectangles.
313 |
# File 'rdoc-sources/FXDC.rb', line 313 def drawRectangle(x, y, w, h) ; end |
#drawRectangles(rectangles) ⇒ Object
Draw multiple rectangles, where rectangles is an array of FXRectangle instances.
Parameters:
rectangles
-
an array of FXRectangle instances [Array]
See also #drawRectangle, #fillRectangle and #fillRectangles.
324 |
# File 'rdoc-sources/FXDC.rb', line 324 def drawRectangles(rectangles) ; end |
#drawRoundRectangle(x, y, w, h, ew, eh) ⇒ Object
Draw a rounded rectangle with ellipse width ew and ellipse height eh.
Parameters:
x
-
x-coordinate of the upper left corner of the bounding rectangle [Integer]
y
-
y-coordinate of the upper left corner of the bounding rectangle [Integer]
w
-
width of the bounding rectangle, in pixels [Integer]
h
-
height of the bounding rectangle, in pixels [Integer]
336 |
# File 'rdoc-sources/FXDC.rb', line 336 def drawRoundRectangle(x, y, w, h, ew, eh); end |
#drawText(x, y, string) ⇒ Object
Draw string at position (x, y).
Parameters:
x
-
x-coordinate of the upper left corner [Integer]
y
-
y-coordinate of the upper left corner [Integer]
string
-
the text string to draw [String]
See also #drawImageText.
628 |
# File 'rdoc-sources/FXDC.rb', line 628 def drawText(x, y, string) ; end |
#fillArc(x, y, w, h, start, extent) ⇒ Object
Draw filled arc (see documentation for #drawArc).
Parameters:
x
-
x-coordinate of the upper left corner of the bounding rectangle [Integer]
y
-
y-coordinate of the upper left corner of the bounding rectangle [Integer]
w
-
width of the bounding rectangle, in pixels [Integer]
h
-
height of the bounding rectangle, in pixels [Integer]
start
-
starting angle of the arc, in 64ths of a degree [Integer]
extent
-
the path and extent of the arc, relative to the start of the arc (in 64ths of a degree) [Integer]
430 |
# File 'rdoc-sources/FXDC.rb', line 430 def fillArc(x, y, w, h, start, extent) ; end |
#fillArcs(arcs) ⇒ Object
441 |
# File 'rdoc-sources/FXDC.rb', line 441 def fillArcs(arcs) ; end |
#fillChord(x, y, w, h, ang1, ang2) ⇒ Object
413 |
# File 'rdoc-sources/FXDC.rb', line 413 def fillChord(x, y, w, h, ang1, ang2) ; end |
#fillChords(chords, nchords) ⇒ Object
414 |
# File 'rdoc-sources/FXDC.rb', line 414 def fillChords(chords, nchords) ; end |
#fillCircle(x, y, r) ⇒ Object
Draw a filled circle centered at (x, y), with specified radius.
Parameters:
x
:: x-coordinate of the circle’s center [Integer] y
:: y-coordinate of the circle’s center [Integer] r
:: radius of the circle, in pixels [Integer]
See also #drawCircle.
623 624 625 |
# File 'lib/fox16/core.rb', line 623 def fillCircle(x, y, r) fillArc(x-r, y-r, 2*r, 2*r, 0, 360*64) end |
#fillComplexPolygon(points) ⇒ Object
Draw filled polygon, where points is an array of FXPoint instances.
Parameters:
points
-
an array of FXPoint instances [Array]
473 |
# File 'rdoc-sources/FXDC.rb', line 473 def fillComplexPolygon(points) ; end |
#fillComplexPolygonRel(points) ⇒ Object
Draw filled polygon with relative points, where points is an array of FXPoint instances.
Parameters:
points
-
an array of FXPoint instances [Array]
500 |
# File 'rdoc-sources/FXDC.rb', line 500 def fillComplexPolygonRel(points) ; end |
#fillConcavePolygon(points) ⇒ Object
Draw filled polygon, where points is an array of FXPoint instances.
Parameters:
points
-
an array of FXPoint instances [Array]
464 |
# File 'rdoc-sources/FXDC.rb', line 464 def fillConcavePolygon(points) ; end |
#fillConcavePolygonRel(points) ⇒ Object
Draw filled polygon with relative points, where points is an array of FXPoint instances.
Parameters:
points
-
an array of FXPoint instances [Array]
491 |
# File 'rdoc-sources/FXDC.rb', line 491 def fillConcavePolygonRel(points) ; end |
#fillEllipse(x, y, w, h) ⇒ Object
Draw a filled ellipse.
446 |
# File 'rdoc-sources/FXDC.rb', line 446 def fillEllipse(x, y, w, h); end |
#fillPolygon(points) ⇒ Object
Draw filled polygon, where points is an array of FXPoint instances.
Parameters:
points
-
an array of FXPoint instances [Array]
455 |
# File 'rdoc-sources/FXDC.rb', line 455 def fillPolygon(points) ; end |
#fillPolygonRel(points) ⇒ Object
Draw filled polygon with relative points, where points is an array of FXPoint instances.
Parameters:
points
-
an array of FXPoint instances [Array]
482 |
# File 'rdoc-sources/FXDC.rb', line 482 def fillPolygonRel(points) ; end |
#fillRectangle(x, y, w, h) ⇒ Object
Draw filled rectangle with upper-left corner at (x, y) and with width and height (w, h).
Parameters:
x
-
x-coordinate of the upper left corner of the rectangle [Integer]
y
-
y-coordinate of the upper left corner of the rectangle [Integer]
width
-
width of the rectangle, in pixels [Integer]
height
-
height of the rectangle, in pixels [Integer]
See also #drawRectangle, #drawRectangles and #fillRectangles.
388 |
# File 'rdoc-sources/FXDC.rb', line 388 def fillRectangle(x, y, w, h) ; end |
#fillRectangles(rectangles) ⇒ Object
Draw filled rectangles, where rectangles is an array of FXRectangle instances.
Parameters:
rectangles
-
an array of FXRectangle instances [Array]
See also #drawRectangle, #drawRectangles and #fillRectangle.
399 |
# File 'rdoc-sources/FXDC.rb', line 399 def fillRectangles(rectangles) ; end |
#fillRoundRectangle(x, y, w, h, ew, eh) ⇒ Object
Draw a filled rounded rectangle with ellipse width ew and ellipse height eh.
Parameters:
x
-
x-coordinate of the upper left corner of the bounding rectangle [Integer]
y
-
y-coordinate of the upper left corner of the bounding rectangle [Integer]
w
-
width of the bounding rectangle, in pixels [Integer]
h
-
height of the bounding rectangle, in pixels [Integer]
411 |
# File 'rdoc-sources/FXDC.rb', line 411 def fillRoundRectangle(x, y, w, h, ew, eh); end |
#readPixel(x, y) ⇒ Object
Returns a color value (i.e. an FXColor) for the pixel at (x, y).
Parameters:
x
-
x-coordinate of the pixel of interest [Integer]
y
-
y-coordinate of the pixel of interest [Integer]
209 |
# File 'rdoc-sources/FXDC.rb', line 209 def readPixel(x, y) ; end |
#setClipMask(bitmap, dx = 0, dy = 0) ⇒ Object
Set clip mask to bitmap.
Parameters:
bitmap
-
a bitmap to use for clipping Fox::FXBitmap
dx
- Integer
dy
- Integer
See also #setClipRectangle.
698 |
# File 'rdoc-sources/FXDC.rb', line 698 def setClipMask(bitmap, dx=0, dy=0) ; end |
#setClipRectangle(rectangle) ⇒ Object
Set clip rectangle.
Parameters:
rectangle
-
a rectangle that defines the clipping region [Integer]
See also #setClipMask.
669 |
# File 'rdoc-sources/FXDC.rb', line 669 def setClipRectangle(x, y, w, h) ; end |
#setDashes(dashOffset, dashPattern) ⇒ Object
Set dash pattern and dash offset. A dash pattern of [1, 2, 3, 4] is a repeating pattern of 1 foreground pixel, 2 background pixels, 3 foreground pixels, and 4 background pixels. The offset is where in the pattern the system will start counting. The maximum length of the dash pattern array is 32 elements.
Parameters:
dashOffset
-
indicates which element of the dash pattern to start with (zero for the beginning) [Integer]
dashPattern
-
array of integers indicating the dash pattern [Array]
655 |
# File 'rdoc-sources/FXDC.rb', line 655 def setDashes(dashOffset, dashPattern) ; end |