Author Topic: 4k: How to handle "Picture box"?  (Read 273 times)

Peter2

  • Sr. Member
  • ****
  • Posts: 464
4k: How to handle "Picture box"?
« on: July 30, 2018, 08:17:39 AM »
I have a dialogue with a "picture box" control; the control displays a PNG. On each corner of the picture I have an edit-box. The dialogue should be displayed at 4K and at standard monitor.

Now I made two versions of the dialogue:
- one where all font-settings are set to "pixel size"
- one where all font-settings are set to "monitor scale"

The result on 4k is:
- the position and the fonts of all controls is scalled
- BUT the PNG inside is not scaled
- so all edit-boxes are no more on the corners of the red area

What is wrong? What to do to scale the image too?

Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

Peter2

  • Sr. Member
  • ****
  • Posts: 464
Re: 4k: How to handle "Picture box"?
« Reply #1 on: July 30, 2018, 08:19:22 AM »
And here attached the ODCL and Lisp
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

Peter2

  • Sr. Member
  • ****
  • Posts: 464
Re: 4k: How to handle "Picture box"?
« Reply #2 on: August 07, 2018, 05:38:08 AM »
Wake up call (yes, I know - it's by John Mayall)

Who knows how to handle images / pictures integrated in ODCL to fit to different resolutions on different monitors?
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

owenwengerd

  • Administrator
  • Hero Member
  • *****
  • Posts: 2973
    • Outside The Box
Re: 4k: How to handle "Picture box"?
« Reply #3 on: September 09, 2018, 03:07:01 PM »
I think the only reliable solution is to make sure the picture size exactly matches the control size, enable Auto Size for the picturebox control, then move the edit box controls at runtime to hard-coded positions relative to the picturebox. Alternatively you could load the image from a file with (dcl-PictureBox-LoadPictureFile) and set the Stretch argument to T in order to stretch the image to fit the control (but scaling images can cause poor image quality).

Peter2

  • Sr. Member
  • ****
  • Posts: 464
Re: 4k: How to handle "Picture box"?
« Reply #4 on: September 10, 2018, 12:39:18 PM »
Thank you Owen - I will test.
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10