winforms icon indicating copy to clipboard operation
winforms copied to clipboard

use of webp extension as backgroundimage

Open vsfeedback opened this issue 1 year ago • 10 comments

This issue has been moved from a ticket on Developer Community.


Suggestion! There is already a webp part https://learn.microsoft.com/en-us/dotnet/api/system.drawing.imaging.imageformat.webp?view=net-8.0 however. We can't use that kind of image as background. Please add it.


Original Comments

Feedback Bot on 7/10/2024, 00:58 AM:

(private comment, text removed)

vsfeedback avatar Jul 17 '24 23:07 vsfeedback

It's not clear to me what "Background" means in this context. Do you mean in a WinForms or WPF app?

terrajobst avatar Jul 17 '24 23:07 terrajobst

I think this should be moved to dotnet/winforms; SDC is now owned by the Windows Forms team (#83356).

teo-tsirpanis avatar Jul 17 '24 23:07 teo-tsirpanis

cc @JeremyKuhne

ViktorHofer avatar Jul 18 '24 10:07 ViktorHofer

Duplicate of #9014, #9107, #10559

elachlan avatar Jul 18 '24 11:07 elachlan

@JeremyKuhne @elachlan It looks like we should have one tracking issue for missing support for WebP then? Are these issues all the same?

terrajobst avatar Jul 18 '24 23:07 terrajobst

This is what was previously communicated:

Unfortunately, there isn't anything we can do here as we're interacting directly with GDI+, which doesn't support this. Please see our recommendations for other libraries to consider for more modern graphics support.

https://github.com/dotnet/runtime/issues/76237#issuecomment-1469009299

elachlan avatar Jul 18 '24 23:07 elachlan

Webp is supported in theory, I'm looking into the details.

JeremyKuhne avatar Jul 19 '24 02:07 JeremyKuhne

Not sure what exactly the constraints are, I need to debug. Ultimately, we're relying on GDI+, which does have a wrapper for the WIC codec for this. I didn't get a smoke test to load, I need to find some time to debug. Whatever the result of that is, we're dependent on Windows here and this is not an area they are investing in.

JeremyKuhne avatar Aug 07 '24 18:08 JeremyKuhne

Not sure if this is relevant to the issue, but apparently Gdiplus does not load external codecs like webp without specifying StartupParameters = 4 in GdiplusStartupInputEx (currently initialized with 0). I'm testing in Windows 11 25H2 (build 26200.6899).

Descolada avatar Nov 09 '25 13:11 Descolada

Documentation for StartupParameters https://learn.microsoft.com/en-us/windows/win32/api/gdiplusinit/ne-gdiplusinit-gdiplusstartupparams

The value in question is in preview.

GdiplusStartupReserved0
Value: 0x00000004
Still in preview.

@JeremyKuhne documentation hasn't been updated since Feb-2024. Is there someone we can ask to see if its now "stable" in windows 11?

elachlan avatar Nov 09 '25 21:11 elachlan