Comments (9)
After investigating, we found that these line doubles the translation of the image in the x- and y-axes.
winforms/src/System.Drawing.Common/src/System/Drawing/Icon.cs
Lines 433 to 435 in 8c2405a
On the main branch, this issue has been fixed by #10645.
from winforms.
@Olina-Zhang can your team please test this?
from winforms.
This is my result on main branch.
private void Form1_Paint(object sender, PaintEventArgs e)
{
Rectangle bounds = new(0, 0, 64, 64);
e.Graphics.TranslateTransform(64, 32);
e.Graphics.DrawIcon(Icon, bounds);
Rectangle rectangleBounds = new(4, 4, 56, 56);
e.Graphics.FillRectangle(Brushes.Blue, rectangleBounds);
}
Here is the code that does the transform:
winforms/src/System.Drawing.Common/src/System/Drawing/Icon.cs
Lines 360 to 375 in 2a6733d
If I comment out the transform I get:
from winforms.
@elachlan Verified this issue on ScratchProject of winforms repo, latest .NET 9.0.100-preview.7.24329.1 and .NET Framework, the test results are the same:
.NET 8.0 test result:
from winforms.
@MandiMan Is the top result from framework on .NET9 Preview?
from winforms.
@elachlan I used the project attached to the Issue description to verify it on the latest .NET 9.0.100-preview.7.24329.1 with the following result:
When I add Rectangle rectangleBounds = new(4, 4, 56, 56);
, the test result is as follows:
Also, An existing issue on this topic, mentioned in the Issue description, was verified with different results on .NET 8.0 and the latest .NET 9.0.
.NET 8.0 still doesn't reproduce:
.NET 9.0 reproduces it again, but the result is different from the original issue, which was a downward offset, and is now an upward offset:
from winforms.
@SimonZhao888 how difficult is the fix for .NET8/6?
from winforms.
Hi @MandiMan,
And for the existing issue, I can't repo on the main branch
I found that the code in the case project has a manual offset that we need to change it manually, it should be 0.
from winforms.
und that the code in the case project has a manual offset that we need to change manually,
It's hard to assess, but judging from Jeremy's PR, there are a lot of changes made.
from winforms.
Related Issues (20)
- Unstable unit test: System.Windows.Forms.Tests.TextBoxBaseTests.TextBoxBase_Undo_CanUndo_Success
- Unstable unit test: System.Windows.Forms.Tests.MenuStripTests.MenuStrip_WndProc_InvokeMouseActivate_Success
- Unstable unit test: System.Windows.Forms.Tests.MenuStripTests.MenuStrip_WndProc_InvokeMouseActivateWithHandle_Success
- Assembly.GetType Throws Exception When Using ControlDesigner in Netcore using Microsoft SDK HOT 6
- Visual Basic Logging configuration via config file broken
- No 8.0.5 or 8.0.6 release? HOT 3
- KeyUp fired many times when RDP session get focus HOT 8
- When the helpNamespace property in helpProvider is blank after delete the previous saved URL, project exit from runtime automatically when press F1 HOT 11
- Introduce Analyzers for correctly guiding the handling of modal dialogs
- [dotnet-sdk-9.0.100-preview.6.24325.8] NotatnikMechanika get System.PlatformNotSupportedException: BinaryFormatter serialization and deserialization have been removed. HOT 3
- [dotnet-sdk-9.0.100-preview.6.24325.8] paintdotnet get System.NotSupportedException: BinaryFormatter serialization and deserialization have been removed HOT 8
- [dotnet-sdk-9.0.100-preview.6.24325.8] Bulk-Crap-Uninstaller launch failed with error: Exception type : System.PlatformNotSupportedException Message : BinaryFormatter serialization and deserialization have been removed HOT 4
- [dotnet-sdk-9.0.100-preview.6.24325.8] JexusManager get System.PlatformNotSupportedException: BinaryFormatter serialization and deserialization have been removed. HOT 3
- [dotnet-sdk-9.0.100-preview.6.24325.8] mRemote launch failed with an exception : PlatformNotSupportedException: BinaryFormatter serialization and deserialization have been removed." HOT 3
- When a ComboBox's data source is bound to an ImmutableArray, its value is reset when it loses focus. HOT 3
- BinaryFormatter error when clicking "Add Tab" command for TabControl in DemoConsole application HOT 4
- Form and controls are not scaled well on HDPI primary monitor when setting custom ApplicationDefaultFont HOT 5
- missing support for complex DataBinding HOT 4
- BinaryFormatter error when Copy/Cut/Paste menu item in DemoConsole application HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winforms.