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
LineStyle
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

Type Aliases§

Coordf
f64 Coordinates
Rect
i32 Coordinates