Skip to content

[release/10.0] Fix Clipboard.GetDataObject().GetImage regression for bitmap images#14462

Merged
Shyam-Gupta merged 7 commits intorelease/10.0from
backport/pr-14427-to-release/10.0
Apr 13, 2026
Merged

[release/10.0] Fix Clipboard.GetDataObject().GetImage regression for bitmap images#14462
Shyam-Gupta merged 7 commits intorelease/10.0from
backport/pr-14427-to-release/10.0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 10, 2026

Fixes #14423

main branch commit #14427

Description/Customer Impact

In .NET 10/11, it is not possible to use Clipboard.GetDataObject().GetImage() API to retrieve images from the Clipboard. This API returns null.

Root cause

In .NET 10, Clipboard was updated to use the new typed + NRBF pipeline. In this new approach, bitmap images are stored mainly in the ITypedDataObject typed store, but DataObject.GetImage still reads from the legacy GetData store and hence the Clipboard.GetDataObject().GetImage() can no longer see those images on .NET 10/11 and returns null.

Fix

Updated DataObject.GetImage() API to use TryGetData<Image>(DataFormats.Bitmap, autoConvert: true, out image) which returns image using the new typed/NRBF code.

Regression

Regression from .NET 9.0. Introduced by commit #11545

Risk

Very low. Another public API, Clipboard.GetImage() already uses TryGetData<T> API and is working fine.

Testing

Manual testing and added unit test for this scenario

Microsoft Reviewers: Open in CodeFlow

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 97.61905% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.10484%. Comparing base (21ac3a2) to head (630bb4c).
⚠️ Report is 2 commits behind head on release/10.0.

Additional details and impacted files
@@                  Coverage Diff                   @@
##           release/10.0      #14462         +/-   ##
======================================================
- Coverage      77.10846%   77.10484%   -0.00362%     
======================================================
  Files              3273        3273                 
  Lines            645033      645062         +29     
  Branches          47702       47704          +2     
======================================================
- Hits             497375      497374          -1     
- Misses           143984      144011         +27     
- Partials           3674        3677          +3     
Flag Coverage Δ
Debug 77.10484% <97.61905%> (-0.00362%) ⬇️
integration 18.98606% <0.00000%> (-0.00314%) ⬇️
production 51.91990% <100.00000%> (-0.01007%) ⬇️
test 97.40991% <97.56098%> (-0.00008%) ⬇️
unit 49.33526% <100.00000%> (-0.00696%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Shyam-Gupta Shyam-Gupta added this to the .NET 10.0 milestone Apr 10, 2026
@Shyam-Gupta Shyam-Gupta added area-Clipboard Issues related to Clipboard and removed area-Infrastructure labels Apr 10, 2026
@Shyam-Gupta Shyam-Gupta modified the milestones: .NET 10.0, 10.0.7 Apr 13, 2026
@Shyam-Gupta Shyam-Gupta added servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria servicing-approved .NET Shiproom approved the PR for merge and removed servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria labels Apr 13, 2026
@Shyam-Gupta
Copy link
Copy Markdown
Member

Approved over email.

@Shyam-Gupta Shyam-Gupta merged commit 7abc1aa into release/10.0 Apr 13, 2026
8 checks passed
@Shyam-Gupta Shyam-Gupta deleted the backport/pr-14427-to-release/10.0 branch April 13, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Clipboard Issues related to Clipboard servicing-approved .NET Shiproom approved the PR for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants