You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks @weltkante the WPF uses win32 method to show the splash screen and my title is not all right. But the code need many WPF feature. And I suggest that we can use all win32 methods to create a splash screen that means that this code can run in a console project.
Reacted by RyzenWang, walterlv, Acoris, Shaojun Li, kronic and Poopooracoocoo
I don't see the difference, both the WPF code and your linked example use CreateWindow API to create a native window. They then use different native APIs for showing the image, but that shouldn't make much of a difference, if anything the WPF code using plain GDI should be faster than your sample which first needs to load the GDI+ library. The performance difference must be coming from somewhere else than creating and showing the window.
In fact, if you look at the WPF source I linked and scroll up the resource lookup says it can be pretty slow (200-300ms) so I suspect the fact that WPF wants to localize the splash screen is what makes up for the performance difference.
Maybe adding support for other sources of splash screen images (like you requested) will fix the performance difference. I don't think the window logic itself needs to be changed, just the image lookup.
In either case your issue title is not accurate, WPF already uses win32 API to show the splash screen, what you are asking about is to make it faster and more flexible ...
In either case your issue title is not accurate, WPF already uses win32 API to show the splash screen, what you are asking about is to make it faster and more flexible
@weltkante Yes, I updated my summary but I do not find a good title.
I don't see the difference, both the WPF code and your linked example use CreateWindow API to create a native window. They then use different native APIs for showing the image, but that shouldn't make much of a difference, if anything the WPF code using plain GDI should be faster than your sample which first needs to load the GDI+ library. The performance difference must be coming from somewhere else than creating and showing the window.
In fact, if you look at the WPF source I linked and scroll up the resource lookup says it can be pretty slow (200-300ms) so I suspect the fact that WPF wants to localize the splash screen is what makes up for the performance difference.
Maybe adding support for other sources of splash screen images (like you requested) will fix the performance difference. I don't think the window logic itself needs to be changed, just the image lookup.
In either case your issue title is not accurate, WPF already uses win32 API to show the splash screen, what you are asking about is to make it faster and more flexible ...
@weltkante@lindexi GDI+ is used for gif transparent image. And from the code i can see that WPF use WIC to load Image. May this cause performance difference?
Yes loading WIC costs time, but its a native component (no JIT) so probably comparable to loading GDI+ in the other example. Considering the comment I linked already says resource loading slows down by 200-300ms, and OP is saying WPF is ~200ms slower than the other example, there is very little ambiguity where it comes from (assuming the comment isn't outdated). Any further speculation doesn't make much sense without doing actual profiling or measurements.
Yes, maybe we should do profiling to get the real reason.
But now splash image in WPF has a noticeable delay before it is displayed. While in the example we can see the splash image immediately. We have a bad experience with delay, and want to see it immediately. This is the main purpose for this issuses.
Activity
weltkante commentedon Oct 10, 2019
WPF is already using plain win32 to show the splash screen (i.e. the splash screen is not a WPF window).
The performance difference you see must come from somewhere else.
lindexi commentedon Oct 10, 2019
@weltkante Thank you. But not at all, see https://github.com/kkwpsv/SplashImage and I will edit my summary.
weltkante commentedon Oct 10, 2019
I don't see the difference, both the WPF code and your linked example use CreateWindow API to create a native window. They then use different native APIs for showing the image, but that shouldn't make much of a difference, if anything the WPF code using plain GDI should be faster than your sample which first needs to load the GDI+ library. The performance difference must be coming from somewhere else than creating and showing the window.
In fact, if you look at the WPF source I linked and scroll up the resource lookup says it can be pretty slow (200-300ms) so I suspect the fact that WPF wants to localize the splash screen is what makes up for the performance difference.
Maybe adding support for other sources of splash screen images (like you requested) will fix the performance difference. I don't think the window logic itself needs to be changed, just the image lookup.
In either case your issue title is not accurate, WPF already uses win32 API to show the splash screen, what you are asking about is to make it faster and more flexible ...
lindexi commentedon Oct 10, 2019
@weltkante Yes, I updated my summary but I do not find a good title.
kkwpsv commentedon Oct 10, 2019
@weltkante @lindexi GDI+ is used for gif transparent image. And from the code i can see that WPF use WIC to load Image. May this cause performance difference?
weltkante commentedon Oct 10, 2019
Yes loading WIC costs time, but its a native component (no JIT) so probably comparable to loading GDI+ in the other example. Considering the comment I linked already says resource loading slows down by 200-300ms, and OP is saying WPF is ~200ms slower than the other example, there is very little ambiguity where it comes from (assuming the comment isn't outdated). Any further speculation doesn't make much sense without doing actual profiling or measurements.
mikedn commentedon Oct 10, 2019
And GDI+ uses WIC internally so by using GDI+ you'll probably end up loading both and wasting more time.
kkwpsv commentedon Oct 10, 2019
Yes, maybe we should do profiling to get the real reason.
But now splash image in WPF has a noticeable delay before it is displayed. While in the example we can see the splash image immediately. We have a bad experience with delay, and want to see it immediately. This is the main purpose for this issuses.