Supports copying of graphical data to the clipboard.
More...
#include <Fl_Copy_Surface.H>
|
const char * | class_name () |
| Returns the name of the class of this object. More...
|
|
void | draw (Fl_Widget *widget, int delta_x=0, int delta_y=0) |
| Copies a widget in the clipboard. More...
|
|
void | draw_decorated_window (Fl_Window *win, int delta_x=0, int delta_y=0) |
| Copies a window and its borders and title bar to the clipboard. More...
|
|
| Fl_Copy_Surface (int w, int h) |
| Constructor. More...
|
|
int | h () |
| Returns the pixel height of the copy surface.
|
|
void | set_current () |
| Make this surface the current drawing surface. More...
|
|
int | w () |
| Returns the pixel width of the copy surface.
|
|
| ~Fl_Copy_Surface () |
| Destructor.
|
|
const char * | class_name () |
| Returns the name of the class of this object. More...
|
|
Fl_Graphics_Driver * | driver () |
| Returns the graphics driver of this drawing surface.
|
|
void | driver (Fl_Graphics_Driver *graphics_driver) |
| Sets the graphics driver of this drawing surface.
|
|
virtual void | set_current (void) |
| Make this surface the current drawing surface. More...
|
|
virtual | ~Fl_Surface_Device () |
| The destructor.
|
|
virtual const char * | class_name () |
| Returns the name of the class of this object. More...
|
|
virtual | ~Fl_Device () |
| Virtual destructor. More...
|
|
|
static const char * | class_id = "Fl_Copy_Surface" |
|
static const char * | class_id = "Fl_Surface_Device" |
|
static const char * | class_id = "Fl_Device" |
| A string that identifies each subclass of Fl_Device. More...
|
|
Supports copying of graphical data to the clipboard.
After creation of an Fl_Copy_Surface object, call set_current() on it, and all subsequent graphics requests will be recorded in the clipboard. It's possible to draw widgets (using Fl_Copy_Surface::draw() ) or to use any of the Drawing functions or the Color & Font functions. Finally, delete the Fl_Copy_Surface object to load the clipboard with the graphical data.
Fl_GL_Window 's can be copied to the clipboard as well.
Usage example:
delete copy_surf;
Supports copying of graphical data to the clipboard.
Definition: Fl_Copy_Surface.H:51
Fl_Copy_Surface(int w, int h)
Constructor.
Definition: Fl_Copy_Surface.cxx:71
void set_current()
Make this surface the current drawing surface.
Definition: Fl_Copy_Surface.cxx:173
void draw(Fl_Widget *widget, int delta_x=0, int delta_y=0)
Copies a widget in the clipboard.
Definition: Fl_Copy_Surface.cxx:168
static Fl_Display_Device * display_device()
Returns the platform display device.
Definition: Fl_Device.cxx:83
virtual void set_current(void)
Make this surface the current drawing surface.
Definition: Fl_Device.cxx:44
void fl_color(Fl_Color c)
Sets the color for all subsequent drawing operations.
Definition: fl_draw.H:52
void fl_rectf(int x, int y, int w, int h)
Colors with current color a rectangle that exactly fills the given bounding box.
Definition: fl_draw.H:206
Platform details:
- MSWindows: Transparent RGB images copy without transparency. The graphical data are copied to the clipboard as an 'enhanced metafile'.
- Mac OS: The graphical data are copied to the clipboard (a.k.a. pasteboard) in two 'flavors': 1) in vectorial form as PDF data; 2) in bitmap form as a TIFF image. Applications to which the clipboard content is pasted can use the flavor that suits them best.
- X11: the graphical data are copied to the clipboard as an image in BMP format.
◆ Fl_Copy_Surface()
Fl_Copy_Surface::Fl_Copy_Surface |
( |
int |
w, |
|
|
int |
h |
|
) |
| |
Constructor.
- Parameters
-
w | and |
h | are the width and height of the clipboard surface in pixels where drawing will occur. |
◆ class_name()
const char * Fl_Copy_Surface::class_name |
( |
| ) |
|
|
inlinevirtual |
Returns the name of the class of this object.
Use of the class_name() function is discouraged because it will be removed from future FLTK versions.
The class of an instance of an Fl_Device subclass can be checked with code such as:
if ( instance->class_name() == Fl_Printer::class_id ) { ... }
Reimplemented from Fl_Device.
◆ draw()
void Fl_Copy_Surface::draw |
( |
Fl_Widget * |
widget, |
|
|
int |
delta_x = 0 , |
|
|
int |
delta_y = 0 |
|
) |
| |
Copies a widget in the clipboard.
- Parameters
-
widget | any FLTK widget (e.g., standard, custom, window, GL view) to copy |
delta_x | and |
delta_y | give the position in the clipboard of the top-left corner of the widget |
◆ draw_decorated_window()
void Fl_Copy_Surface::draw_decorated_window |
( |
Fl_Window * |
win, |
|
|
int |
delta_x = 0 , |
|
|
int |
delta_y = 0 |
|
) |
| |
Copies a window and its borders and title bar to the clipboard.
- Parameters
-
win | an FLTK window to copy |
delta_x | and |
delta_y | give the position in the clipboard of the top-left corner of the window's title bar |
◆ set_current()
void Fl_Copy_Surface::set_current |
( |
void |
| ) |
|
|
virtual |
Make this surface the current drawing surface.
This surface will receive all future graphics requests.
Reimplemented from Fl_Surface_Device.
The documentation for this class was generated from the following files: