-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to not use WebRequest for PictureBox #6684
Conversation
src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Igor Velikorossov <[email protected]>
Co-authored-by: Igor Velikorossov <[email protected]>
If subsequently apply kant2002@7ce82f2 then application trimmed to 15Mb and that with reflection |
src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
Outdated
Show resolved
Hide resolved
@RussKie do you think, this PR require some additional work? |
Apologies for the delay, I’m working on multiple streams and stretched pretty thin atm. I’ll try to get to this asapp.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd stick with putting this in the existing Task.Run
and avoid introducing async
.
@JeremyKuhne did I infer your proposal correctly? |
src/System.Windows.Forms/src/System/Windows/Forms/PictureBox.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spending some more time looking at this I think you'd be better off using the existing ReadCallBack()
. Let me know if that doesn't work for you or if you have any other questions.
@kant2002 appreciate your effort here. |
@JeremyKuhne reason why I did use Anyway, I update as you suggest the code. I do not have questions and this approach is fine. |
Normally, I'd agree. As this code predates
I think the default position should be "no differences in functionality". We can, of course, alter that based on data and discussion. Again, thanks for your effort here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Indirectly related to #1756 because if that would work, I would be able to fix #1756 using the same approach.
WebRequest bring ton of code to WinForms which is old, and not really interesting. NativeAOT suffer from this.
Inspired by dotnet/runtime#38397
By itself if applying
<RuntimeHostConfigurationOption Include="System.Windows.Forms.PictureBox.UseWebRequest" Value="false" Trim="true" />
it will shave 1Mb from 20Mb of my sample application which compiled under NativeAOT. I include all controls in that application.Microsoft Reviewers: Open in CodeFlow