From 8286e37b18dcbf788cea188a9f1df5824baf0731 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 9 Apr 2019 18:50:18 +0200 Subject: Add public function Fl_RGB_Image *fl_capture_window_part() In the context of HighDPI screens, the API of function fl_read_image() is inadequate because a rectangle of size WxH drawing units of a window may contain many more than W*H pixels. Function fl_capture_window_part() returns an Fl_RGB_Image object whose drawing size matches the size of the rectangle and whose data size matches the, possibly larger, size in pixels of the corresponding area of the mapped window. --- FL/fl_draw.H | 1 + 1 file changed, 1 insertion(+) (limited to 'FL') diff --git a/FL/fl_draw.H b/FL/fl_draw.H index f1a867071..3805190b3 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -794,6 +794,7 @@ inline void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int inline char fl_can_do_alpha_blending() {return Fl_Graphics_Driver::default_driver().can_do_alpha_blending();} FL_EXPORT uchar *fl_read_image(uchar *p,int X,int Y,int W,int H,int alpha=0); +FL_EXPORT Fl_RGB_Image *fl_capture_window_part(Fl_Window *win, int x, int y, int w, int h); // pixmaps: /** -- cgit v1.2.3