Author Topic: High DPI and TAChart  (Read 624 times)


  • Newbie
  • Posts: 1
High DPI and TAChart
« on: October 25, 2018, 10:02:32 am »
Hi to All!
I am new here and currently I am learning how to use TAChart. I am impressed by its capabilities, however, I have problem with high screen resolution of my laptop (win10) on which Lazarus is installed.  In order to run programs also on older machines I use LCL scaling and DPI awareness. As a result, the sizes of frame, controls, chart etc. are properly scaled but fonts, markers of data points and axes intervals are too large when displayed with lower DPI. Also the thickness of lines is not scaled. Is it normal or I missed something?
Thanks in advance,


  • Hero Member
  • *****
  • Posts: 5294
Re: High DPI and TAChart
« Reply #1 on: October 26, 2018, 11:18:56 am »
This is certainly not a beginner's question, even if you maybe consider yourself as a beginner. The correct place to post it would have been the TAChart subforum. I was not able to answer your question during this week, and finding TAChart-related postes scattered over the entire forum makes it extremely difficult to answer because the question will flow out of the "Recent" column usually on the following day.

Returning to your question: I must confess that some size dimensions were forgotten when high-DPI scaling was introduced, and I try to add the needed code soon.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10


  • Hero Member
  • *****
  • Posts: 1127
Re: High DPI and TAChart
« Reply #2 on: October 26, 2018, 05:55:52 pm »
I have been working on an app where there are objects I drag and drop on the design sheet, much like Laz does now and decided
to use a TCONTROL as a base class because I it had all the mouse control I needed but I also needed to be able to
scale the objects to a metric ..

 I added a mmWidth and mmHeight and now call it a TMMCONTROL and base all my objects from that.

 the idea is that it automatically calculates the pixel size against the PPI of the system so I can set the control via the
metric style or the normal pixel style. Reading the values simply translate what is there and internally all of the drawing is still
done via pixels, its just the sizes can now be set via properties of pixel or mm.

 so now I can just set it via mm and it'll always be the same from system to system.

 Wondered if anyone has ever thought of adding a metric setting to select between mm or inches on an additional set of
properties that will set the control size ?