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? Manolo Feb 24, 2021  
 

On Wednesday, February 24, 2021 at 8:38:48 PM UTC+1 Ian MacArthur wrote:
On 24 Feb 2021, at 17:59, 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. The result is that lines have a constant width, set to 1, 2 and 3
> with growing scale factor values.

Neat, didn’t know that worked.

Can you change the scale factor during a draw() method? I wonder if you could use this technique to, for example, have the text scale “normally” with the DPI, but force lines always to be scale 1.0, or etc...?

Please, look at my example program button.cxx that does exactly this.

--
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/9f00dc6b-7cdc-4f1d-8827-960cfb13b81fn%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'.