Module draw
Available on crate feature
dep_fltk
only.Expand description
Drawing primitives
Structs§
- Coord
i32
Coordinates- Coordinates
- Defines a pair of
x, y
coordinates - Line
Style - Defines the line styles supported by fltk
- Offscreen
- Opaque type around
Fl_Offscreen
- Region
- Opaque type around
Fl_Region
Functions§
- begin_
complex_ polygon - Starts drawing a complex filled polygon
- begin_
line - Starts drawing a list of lines
- begin_
loop - Starts drawing a closed sequence of lines
- begin_
points - Starts drawing a list of points. Points are added to the list with
fl_vertex()
- begin_
polygon - Starts drawing a convex filled polygon
- can_
do_ alpha_ blending - Checks whether platform supports true alpha blending for RGBA images
- capture_
offscreen - Captures the offscreen and returns raw data. Example usage:
- capture_
surface - Captures the image surface object and returns raw data. Example usage:
- capture_
window - Captures the window and returns raw data. Example usage:
- capture_
window_ part - Captures part of the window and returns raw data. Example usage:
- char_
width - Returns the typographical width of a single character
- clip_
region - Gets the clip region
- descent
- Returns the recommended distance above the bottom of a height() tall box to draw the text at so it looks centered vertically in that box
- draw_
arc - Draws an arc
- draw_
arc2 - Draws an arc
- draw_
box - Draws a box given the box type, size, position and color
- draw_
check - Draw a check mark
- draw_
circle - Draws a circle
- draw_
circle_ fill - Draws a filled circle
- draw_
curve - Adds a series of points on a Bezier curve to the path
- draw_
focus_ rect - Draws a focus rectangle
- draw_
frame - Draws a series of line segments around the given box.
- draw_
frame2 - Draws a series of line segments around the given box
- draw_
image - Draw an image into a widget.
Requires a call to
app::set_visual(Mode::Rgb8).unwrap()
. Doesn’t support transparency, for that you would have to use RgbImage. - draw_
image2 ⚠ - Draw an image into a widget.
Requires a call to
app::set_visual(Mode::Rgb8).unwrap()
. A negative depth flips the image horizontally, while a negative line data flips it vertically. Allows passing a line-data parameter - draw_
line - Draws a line
- draw_
line2 - Draws a line from (x,y) to (x1,y1) and another from (x1,y1) to (x2,y2)
- draw_
loop - Draws a non-filled 3-sided polygon
- draw_
loop2 - Draws a non-filled 3-sided polygon
- draw_
loop3 - Draws a non-filled 4-sided polygon
- draw_
pie - Draws a filled pie
- draw_
point - Draws a point
- draw_
point2 - Draws a point
- draw_
polygon - Fills a 3-sided polygon. The polygon must be convex
- draw_
polygon2 - Fills a 3-sided polygon. The polygon must be convex
- draw_
polygon3 - Fills a 4-sided polygon. The polygon must be convex
- draw_
rbox - Draws a rounded box
- draw_
rect - Draws a rectangle
- draw_
rect_ fill - Draws a filled rectangle
- draw_
rect_ with_ color - Draws a rectangle with border color
- draw_
rectf - Draws a filled rectangle
- draw_
rectf_ with_ rgb - Draws a filled rectangle with specified RGB color
- draw_
rgb - Draw a framebuffer (rgba) into a widget
- draw_
rgb_ ⚠nocopy - Draw a framebuffer (rgba) into a widget
- draw_
rgba - Draw a framebuffer (rgba) into a widget
- draw_
rgba_ ⚠nocopy - Draw a framebuffer (rgba) into a widget
- draw_
rounded_ rect - Draws a rounded rectangle
- draw_
rounded_ rectf - Draws a filled rounded rectangle
- draw_
text - Draws a string starting at the given x, y location
- draw_
text2 - Draws a string starting at the given x, y location with width and height and alignment
- draw_
text_ angled - Draws a string starting at the given x, y location, rotated to an angle
- draw_
text_ n - Like draw_text, however uses FLTK’s
fl_draw
which takes the length of the string, so it doesn’t need to allocate - draw_
xyline - Draws a horizontal line from (x,y) to (x1,y)
- draw_
xyline2 - Draws a horizontal line from (x,y) to (x1,y), then vertical from (x1,y) to (x1,y2)
- draw_
xyline3 - Draws a horizontal line from (x,y) to (x1,y), then a vertical from (x1,y) to (x1,y2) and then another horizontal from (x1,y2) to (x3,y2)
- draw_
yxline - Draws a vertical line from (x,y) to (x,y1)
- draw_
yxline2 - Draws a vertical line from (x,y) to (x,y1), then a horizontal from (x,y1) to (x2,y1)
- draw_
yxline3 - Draws a vertical line from (x,y) to (x,y1) then a horizontal from (x,y1) to (x2,y1), then another vertical from (x2,y1) to (x2,y3)
- end_
complex_ polygon - Ends complex filled polygon, and draws
- end_
line - Ends list of lines, and draws
- end_
loop - Ends closed sequence of lines, and draws
- end_
points - Ends list of points, and draws
- end_
polygon - Ends closed sequence of lines, and draws
- font
- Gets the current font, which is used in various drawing routines
- gap
- Call gap() to separate loops of the path
- get_
color - Gets the last used color
- height
- Returns the recommended minimum line spacing for the current font
- latin1_
to_ local - Converts text from Windows/X11 latin1 character set to local encoding
- local_
to_ latin1 - Converts text from local encoding to Windowx/X11 latin1 character set
- measure
- Measure the width and height of a text
- mult_
matrix - Concatenates another transformation onto the current one
- not_
clipped - Returns whether the rectangle intersect with the current clip region
- overlay_
clear - Erase a selection rectangle without drawing a new one
- overlay_
rect - Draws a selection rectangle, erasing a previous one by XOR’ing it first.
- override_
scale - Override the drawing scale
- pop_
clip - Puts the drawing back
- pop_
matrix - Pops the current transformation matrix from the stack
- push_
clip - Limits drawing to a region
- push_
matrix - Saves the current transformation matrix on the stack
- push_
no_ clip - Pushes an empty clip region onto the stack so nothing will be clipped
- reset_
spot - Resets the spot within the window
- restore_
clip - Restores the clip region
- restore_
scale - Restore the drawing scale
- rotate
- Concatenates rotation transformation onto the current one
- rtl_
draw - Draws a UTF-8 string right to left starting at the given x, y location
- scale
- Concatenates scaling transformation onto the current one for both x & y
- scale_
xy - Concatenates scaling transformation onto the current one
- set_
clip_ region - Sets the clip region
- set_
color_ rgb - Sets the color using rgb values
- set_
cursor - Sets the cursor style
- set_
cursor_ with_ color - Sets the cursor style
- set_
draw_ color - Sets the drawing color
- set_
draw_ hex_ color - Sets the drawing color
- set_
draw_ rgb_ color - Sets the drawing color
- set_
font - Sets the current font, which is then used in various drawing routines
- set_
height - Sets the line spacing for the current font
- set_
line_ style - Sets the line style
- set_
spot - Sets spot within the window
- set_
status - Sets the status
- shortcut_
label - Get a human-readable string from a shortcut value
- show_
colormap - Shows a color map
- size
- Gets the current font size, which is used in various drawing routines
- text_
extents - Measure the coordinates and size of the text where a bounding box using the returned data would fit the text
- transform_
dx - Transforms distance using current transformation matrix
- transform_
dy - Transforms distance using current transformation matrix
- transform_
x - Transforms coordinate using the current transformation matrix
- transform_
y - Transforms coordinate using the current transformation matrix
- transformed_
vertex - Adds coordinate pair to the vertex list without further transformations
- translate
- Concatenates translation transformation onto the current one
- vertex
- Adds a single vertex to the current path
- width
- Returns the typographical width of a string
- width2
- Returns the typographical width of a sequence of n characters
- wrap_
measure - Measure the width and height of a text