FLTK logo

Re: [fltk.general] Re: Can custom box type functions handle their own high-DPI screen scaling?

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.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

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.

--
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 ]
 
     
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'.