-
Notifications
You must be signed in to change notification settings - Fork 1.1k
(Perf) avoid saving ListView BackgroundImage to disk #5755
Copy link
Copy link
Open
Labels
api-suggestion(1) Early API idea and discussion, it is NOT ready for implementation(1) Early API idea and discussion, it is NOT ready for implementationarea-controls-ListViewenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionstenet-performanceImprove performance, flag performance regressions across core releasesImprove performance, flag performance regressions across core releases
Milestone
Metadata
Metadata
Assignees
Labels
api-suggestion(1) Early API idea and discussion, it is NOT ready for implementation(1) Early API idea and discussion, it is NOT ready for implementationarea-controls-ListViewenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionstenet-performanceImprove performance, flag performance regressions across core releasesImprove performance, flag performance regressions across core releases
Type
Fields
Give feedbackNo fields configured for issues without a type.
Is your feature request related to a problem? Please describe.
ListView.BackgroundImageis stored into a temporary file when transferred to the native control. This puts pressure on the temp file namespace and produces additional IO, as well as requiring complex code to manage lifetime of the file and delete it when no longer needed.Noted in PR #5744 while simplifying the temp file generation.
Describe the solution you'd like and alternatives you've considered
ListViewsupports selecting aHBITMAPas background image, so it would make sense to make use of that functionality.While the
BackgroundImageis an arbitraryImagethe old code (before PR #5744) always constructed aBitmapfrom it in order to generate a temp file seed. This means if we'll create a Bitmap from the Image to form a HBITMAP we do not introduce additional restrictions that didn't exist before.Also the
BackgroundImagealways was saved inBMPformat, meaning transparency probably never worked (transparent pixels turned out black in my tests). Note that generating aHBITMAPnaively in .NET fills transparent pixels with a background color. We should investigate whetherListViewis capable of rendering transparent backgrounds properly (there exist flags which seam to indiciate support).Will this feature affect UI controls?
Yes,
ListViewwill change how it implementsBackgroundImageand needs attention to not introduce regressions.No designer or API changes are required.