How to internally deal with custom ppi?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #59037
    Support
    Keymaster

      Hello

      Look, maybe this code can help you to save original size:

      Code:
      uses sSkinManager, sVclUtils;

      var
      iPPI: integer;

      if DefaultManager.IsActive then begin
      if DefaultManager.Options.ScaleMode = smVCL then
      iPPI := DefaultPPI
      else
      iPPI := DefaultManager.Options.PixelsPerInch
      end
      else
      iPPI := 96;

      SaveMainFormWidthHeight(Width * 96 div iPPI, Height * 96 div iPPI);

      #59057
      kaju_74
      Participant
        'Support' wrote:

        Hello

        Look, maybe this code can help you to save original size:

        Code:
        uses sSkinManager, sVclUtils;

        var
        iPPI: integer;

        if DefaultManager.IsActive then begin
        if DefaultManager.Options.ScaleMode = smVCL then
        iPPI := DefaultPPI
        else
        iPPI := DefaultManager.Options.PixelsPerInch
        end
        else
        iPPI := 96;

        SaveMainFormWidthHeight(Width * 96 div iPPI, Height * 96 div iPPI);

        Hi,

        I've figured out nearly the same by playing with it, but: You'll get rounding errors where the form dimension will be shrink by 0-1 pixel each time – so that's not the full solution for me right now…but I've another idea if there's no native support to fix it.

        Thank you very much,

        kaju

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.