summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl_Copy_Surface.H6
-rw-r--r--FL/Fl_Image_Surface.H11
2 files changed, 9 insertions, 8 deletions
diff --git a/FL/Fl_Copy_Surface.H b/FL/Fl_Copy_Surface.H
index 0d7a4f17c..ffe24fe83 100644
--- a/FL/Fl_Copy_Surface.H
+++ b/FL/Fl_Copy_Surface.H
@@ -23,7 +23,7 @@
/** Supports copying of graphical data to the clipboard.
- <br> After creation of an Fl_Copy_Surface object, call set_current() on it, and all subsequent graphics requests
+ <br> After creation of an Fl_Copy_Surface object, make it the current drawing surface calling Fl_Surface_Device::push_current(), 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 \ref fl_drawings or the \ref fl_attributes.
Finally, delete the Fl_Copy_Surface object to load the clipboard with the graphical data.
@@ -32,11 +32,11 @@
\code
Fl_Widget *g = ...; // a widget you want to copy to the clipboard
Fl_Copy_Surface *copy_surf = new Fl_Copy_Surface(g->w(), g->h()); // create an Fl_Copy_Surface object
- copy_surf->set_current(); // direct graphics requests to the clipboard
+ Fl_Surface_Device::push_current(copy_surf); // direct graphics requests to the clipboard
fl_color(FL_WHITE); fl_rectf(0, 0, g->w(), g->h()); // draw a white background
copy_surf->draw(g); // draw the g widget in the clipboard
+ Fl_Surface_Device::pop_current(); // direct graphics requests back to their previous destination
delete copy_surf; // after this, the clipboard is loaded
- Fl_Display_Device::display_device()->set_current(); // direct graphics requests back to the display
\endcode
Platform details:
\li Windows: Transparent RGB images copy without transparency.
diff --git a/FL/Fl_Image_Surface.H b/FL/Fl_Image_Surface.H
index 5c638915e..01c05a87d 100644
--- a/FL/Fl_Image_Surface.H
+++ b/FL/Fl_Image_Surface.H
@@ -28,7 +28,8 @@
/**
\brief Directs all graphics requests to an Fl_Image.
- After creation of an Fl_Image_Surface object, call set_current() on it, and all
+ After creation of an Fl_Image_Surface object, make it the current drawing
+ surface calling Fl_Surface_Device::push_current(), and all
subsequent graphics requests will be recorded in the image. It's possible to
draw widgets (using Fl_Image_Surface::draw()) or to use any of the
\ref fl_drawings or the \ref fl_attributes. Finally, call image() on the object
@@ -44,7 +45,7 @@
Fl_Image_Surface *image_surface = new Fl_Image_Surface(g->w(), g->h());
// direct all further graphics requests to the image
- image_surface->set_current();
+ Fl_Surface_Device::push_current(image_surface);
// draw a white background
fl_color(FL_WHITE);
@@ -55,12 +56,12 @@
// get the resulting image
Fl_RGB_Image* image = image_surface->image();
+
+ // direct graphics requests back to their previous destination
+ Fl_Surface_Device::pop_current();
// delete the image_surface object, but not the image itself
delete image_surface;
-
- // direct graphics requests back to the screen
- Fl_Display_Device::display_device()->set_current();
\endcode
*/
class FL_EXPORT Fl_Image_Surface : public Fl_Widget_Surface {