Recent

Author Topic: TImageList: redraw image at run time from svg files  (Read 375 times)

Lulu

  • Full Member
  • ***
  • Posts: 226
TImageList: redraw image at run time from svg files
« on: August 25, 2023, 10:19:45 pm »
Hi all,
after read this post https://forum.lazarus.freepascal.org/index.php/topic,64364.0.html about TImageList and multiple resolutions, I share the code I use to redraw at run time the images from svg files. With svg, we have almost the same precision whatever the size.
It use BGRABitmap to load and render the svg files.

I don't have a high res monitor (with DPI>96), I'm not sure this code is DPI aware. Does someone can check this please ?

Thanks
wishing you a nice life

lainz

  • Hero Member
  • *****
  • Posts: 4398
    • https://lainz.github.io/
Re: TImageList: redraw image at run time from svg files
« Reply #1 on: August 26, 2023, 03:44:32 am »
Hi. You can change the dpi of your monitor in windows 7 or newer.

No need for a high dpi monitor with 125% will be enough to test.

Notice that we have svg image list in bgracontrols that can be plugged in into a normal image list to populate the bitmaps.

Lulu

  • Full Member
  • ***
  • Posts: 226
Re: TImageList: redraw image at run time from svg files
« Reply #2 on: August 26, 2023, 09:28:42 am »
Hi. You can change the dpi of your monitor in windows 7 or newer.

No need for a high dpi monitor with 125% will be enough to test.
Thank you Lainz for the information, I never used this before.
Restarting the test program (from its binary, not from the IDE to avoid a new compilation with the new DPI) after playing with 125% and 150% it seems to be ok, the icons are not blurred. Yeah !

Notice that we have svg image list in bgracontrols that can be plugged in into a normal image list to populate the bitmaps.
BGRAControls looks good :)
wishing you a nice life

 

TinyPortal © 2005-2018