Re: Re: Can custom box type functions handle their own high-DPI screen scaling?
Albrecht Schlosser
Feb 24, 2021
On 2/24/21 6:59 PM Manolo wrote:
The possibility to draw using an unscaled context is already present in
FLTK 1.4.
The key is to call Fl_Graphics_Driver::scale(float s) to change the
scaling factor and set it to 1. I attach a small
example program that redraws a button label
using an unscaled setting. ...
Great, I think this is exactly what Remy wanted. I modified the test
program a bit drawing three rectangles:
- yellow (line width 1)
- green (line width 1)
- red (line width == scaling factor)
The attached screenshot has been taken with scaling 300% and you can see
the button borders scaled to the same width (3) as the red line and you
can also see the antialiased label. This is from Linux, BTW, and the
image has been zoomed for better visibility.
Since you can change the scaling factor while drawing inside the widget
or box(type) drawing code I believe Remy can do whatever he wants in his
own box drawing code, for instance drawing nice borders and gradients in
full (1-pixel) resolution.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.