|
|
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.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/bd9eb1ac-3f58-d4f7-8748-18d406ac4dda%40online.de.
Attachment:
draw_unscaled.png
Description: PNG image
[ Direct Link to Message ] | |
|
| |