FLTK logo

Re: [fltk.coredev] Re: [master] 9df287b - Cleaner access to Fl_Gl_Window_Driver objects.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: [master] 9df287b - Cleaner access to Fl_Gl_Window_Driver objects. Manolo Apr 30, 2021  
 
@Albrecht:
OK. I had misunderstood your initial proposal. It's not about reconsidering all
trees of classes. It's just about adding to the public API a function to capture
a rectangle in a window, whatever the nature of that window, and to return an
Fl_RGB_Image object. Is that correct ?

That function already exists, it's fl_capture_window_part()
     see https://fltk.gitlab.io/fltk/group__fl__drawings.html#ga74c16eb73f1a1be989a16da9086622f0
The returned Fl_RGB_Image is scaled (with Fl_Image::scale()) so that its drawing size
is the size of the rectangle asked for, and its data size is the number of pixels present
in the captured rectangle which varies with the display's scaling factor.

Thus, it's not a public member of class Fl_Window as you proposed, but it's functionally identical.
We have the possibility to change that since 1.4 is not out yet. Let me know what you believe is best.

However,  I have put this feature in the form of a function rather than a member of class
Fl_Window, I believe, because it is the correct extension of the classic fl_read_image() function
for the situation arising with FLTK 1.4 and HighDPI displays :  behind rectangle
X,Y,W,H in FLTK units there are many more than WxH pixels, and the returned
uchar array of function fl_read_image() is not able to convey that information.
The doc of fl_read_image() proposes a link to the new fl_capture_window_part() :
   https://fltk.gitlab.io/fltk/group__fl__drawings.html#ga0cdc05d3f7689e1c6b8a26fd0bd97233

Thinking about that, we could link to a new Fl_Window::capture_rectangle() member function
just as well.



--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/e842ead2-ff84-4971-8a46-0e251397d2dan%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.