I am happy to announce that I uploaded the first version of High-DPI TImageList. The LCL part should be complete, the win32 part as well. There is one backwards compatibility issue: adding sprites - their support is broken (the image is added as one and not cut into several images). I haven't done the design-time part yet either. That means that the ImageList dialog doesn't support multiple resolutions. But everything else should be good.

+ Good news: I was able to add interpolation support with alpha chanel (did you know FPC supports it? :) ) !!! So images are scaled smoothly and nicely without any external library evolved - and it is supported on all OS/WS. Obviously scaling down works better than scaling up.

For now I tested Win32 only - other widgetsets will be probably broken. I'll take a look into them later.

Issue report with a test project: https://bugs.freepascal.org/view.php?id=32967 Branch to test: https://svn.freepascal.org/svn/lazarus/branches/HiDPIImageList

Please test and comment - especially component vendors.

To take advantage of the new PPI features in your control you have to replace all ImgList.Width, ImgList.Height, ImgList.Draw* etc. methods with PPI-aware properties/constructs. Like: ImgList.Width -> ImgList.WidthForImagePPI[DesiredWidthAt96PPI, Font.PixelsPerInch]
- or -
ImgResolution := ImgList.ResolutionForImagePPI[DesiredWidthAt96PPI, Font.PixelsPerInch];
ImgResolution := ImgList.Resolution[DesiredWidthRegardlessOfPPI];
ImageWidth := ImgResolution.Width;
ImageHeight := ImgResolution.Height;
ImgResolution.Draw(...);
ImgResolution.GetBitmap(...);

etc.

Ondrej
_______________________________________________
Lazarusdev mailing list
[email protected]
https://idefix.freepascal.org/cgi-bin/mailman/listinfo/lazarusdev
-- 
_______________________________________________
Lazarus mailing list
[email protected]
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to