KEMBAR78
[Windows] Implemented the Resize and Downsize functions in the W2DImage class by HarishwaranVijayakumar · Pull Request #29138 · dotnet/maui · GitHub
Skip to content

Conversation

HarishwaranVijayakumar
Copy link
Contributor

@HarishwaranVijayakumar HarishwaranVijayakumar commented Apr 23, 2025

Root Cause of the issue

  • There is no implementation for the Resize and Downsize methods in the PlatformImage class on Windows.

Description of Change

  • Implemented a Resize and Downsize method in the PlatformImage class on Windows.

Issues Fixed

Fixes #16767

Tested the behaviour in the following platforms

  • - Windows
  • - Android
  • - Mac
  • - iOS

Output

Before Fix After Fix
WindowsBeforeFix.mp4
WindowsFix1.mp4

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Apr 23, 2025

using (var resizedStream = new InMemoryRandomAccessStream())
{
AsyncPump.Run(async () => await renderTarget.SaveAsync(resizedStream, CanvasBitmapFileFormat.Png));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #23824, a AsyncPump.Run call was removed and it is not needed. I believe it should be possible to mimick what was done here:

https://github.com/dotnet/maui/pull/23824/files#diff-7809b7d3f7611c78ba9e346d0e686e7f564ec68d1c25bc19bee122f9f9f1439dR179-R180

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do some tests without AsyncPump.Run? Can lead to thread blocking issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MartyIX, As suggested I have modified the code

@jsuarezruiz jsuarezruiz added platform/windows area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing labels Apr 23, 2025
App.WaitForElement(buttonId);
App.Click(buttonId);
App.WaitForElement("Label");
VerifyScreenshotOrSetException(ref exception, screenshotName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending snapshots on Android and Windows.


using (var resizedStream = new InMemoryRandomAccessStream())
{
AsyncPump.Run(async () => await renderTarget.SaveAsync(resizedStream, CanvasBitmapFileFormat.Png));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do some tests without AsyncPump.Run? Can lead to thread blocking issues.

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@HarishwaranVijayakumar HarishwaranVijayakumar changed the title [Windows] Fix for ImagePaint is not rendering in View [Windows] Fix for Resize and Downsize function in W2DImage class is not implemented Apr 25, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@PureWeen PureWeen changed the base branch from main to inflight/current June 9, 2025 19:22
@PureWeen PureWeen merged commit 5442a5e into dotnet:inflight/current Jun 9, 2025
79 of 81 checks passed
github-actions bot pushed a commit that referenced this pull request Jun 10, 2025
…ge class (#29138)

* Fix for GraphicsView ImagePaint

* update for the graphics view imagePaint

* Added testcase

* Implementation for Downsize

* Revert "Added testcase"

This reverts commit ef22fa8.

* Added test case

* Added CreateResizedMethod

* Implemented Resize method

* Fix modification

* Added testcase

* Revert "Added test case"

This reverts commit a79de0d.

* Updated the changes

* Update changes

* Updated the testcase

* Commited the changes

* Updating code

* Update TestCase

* Code Update

* Modify TestCase

* TestCase Updation

* Code update

* Adding Snapshots

* Added snapshots

* Revert "Added snapshots"

This reverts commit cac6f45.

* Refactor code
github-actions bot pushed a commit that referenced this pull request Jun 10, 2025
…ge class (#29138)

* Fix for GraphicsView ImagePaint

* update for the graphics view imagePaint

* Added testcase

* Implementation for Downsize

* Revert "Added testcase"

This reverts commit ef22fa8.

* Added test case

* Added CreateResizedMethod

* Implemented Resize method

* Fix modification

* Added testcase

* Revert "Added test case"

This reverts commit a79de0d.

* Updated the changes

* Update changes

* Updated the testcase

* Commited the changes

* Updating code

* Update TestCase

* Code Update

* Modify TestCase

* TestCase Updation

* Code update

* Adding Snapshots

* Added snapshots

* Revert "Added snapshots"

This reverts commit cac6f45.

* Refactor code
github-actions bot pushed a commit that referenced this pull request Jun 11, 2025
…ge class (#29138)

* Fix for GraphicsView ImagePaint

* update for the graphics view imagePaint

* Added testcase

* Implementation for Downsize

* Revert "Added testcase"

This reverts commit ef22fa8.

* Added test case

* Added CreateResizedMethod

* Implemented Resize method

* Fix modification

* Added testcase

* Revert "Added test case"

This reverts commit a79de0d.

* Updated the changes

* Update changes

* Updated the testcase

* Commited the changes

* Updating code

* Update TestCase

* Code Update

* Modify TestCase

* TestCase Updation

* Code update

* Adding Snapshots

* Added snapshots

* Revert "Added snapshots"

This reverts commit cac6f45.

* Refactor code
github-actions bot pushed a commit that referenced this pull request Jun 11, 2025
…ge class (#29138)

* Fix for GraphicsView ImagePaint

* update for the graphics view imagePaint

* Added testcase

* Implementation for Downsize

* Revert "Added testcase"

This reverts commit ef22fa8.

* Added test case

* Added CreateResizedMethod

* Implemented Resize method

* Fix modification

* Added testcase

* Revert "Added test case"

This reverts commit a79de0d.

* Updated the changes

* Update changes

* Updated the testcase

* Commited the changes

* Updating code

* Update TestCase

* Code Update

* Modify TestCase

* TestCase Updation

* Code update

* Adding Snapshots

* Added snapshots

* Revert "Added snapshots"

This reverts commit cac6f45.

* Refactor code
github-actions bot pushed a commit that referenced this pull request Jun 16, 2025
…ge class (#29138)

* Fix for GraphicsView ImagePaint

* update for the graphics view imagePaint

* Added testcase

* Implementation for Downsize

* Revert "Added testcase"

This reverts commit ef22fa8.

* Added test case

* Added CreateResizedMethod

* Implemented Resize method

* Fix modification

* Added testcase

* Revert "Added test case"

This reverts commit a79de0d.

* Updated the changes

* Update changes

* Updated the testcase

* Commited the changes

* Updating code

* Update TestCase

* Code Update

* Modify TestCase

* TestCase Updation

* Code update

* Adding Snapshots

* Added snapshots

* Revert "Added snapshots"

This reverts commit cac6f45.

* Refactor code
github-actions bot pushed a commit that referenced this pull request Jun 16, 2025
…ge class (#29138)

* Fix for GraphicsView ImagePaint

* update for the graphics view imagePaint

* Added testcase

* Implementation for Downsize

* Revert "Added testcase"

This reverts commit ef22fa8.

* Added test case

* Added CreateResizedMethod

* Implemented Resize method

* Fix modification

* Added testcase

* Revert "Added test case"

This reverts commit a79de0d.

* Updated the changes

* Update changes

* Updated the testcase

* Commited the changes

* Updating code

* Update TestCase

* Code Update

* Modify TestCase

* TestCase Updation

* Code update

* Adding Snapshots

* Added snapshots

* Revert "Added snapshots"

This reverts commit cac6f45.

* Refactor code
github-actions bot pushed a commit that referenced this pull request Jun 19, 2025
…ge class (#29138)

* Fix for GraphicsView ImagePaint

* update for the graphics view imagePaint

* Added testcase

* Implementation for Downsize

* Revert "Added testcase"

This reverts commit ef22fa8.

* Added test case

* Added CreateResizedMethod

* Implemented Resize method

* Fix modification

* Added testcase

* Revert "Added test case"

This reverts commit a79de0d.

* Updated the changes

* Update changes

* Updated the testcase

* Commited the changes

* Updating code

* Update TestCase

* Code Update

* Modify TestCase

* TestCase Updation

* Code update

* Adding Snapshots

* Added snapshots

* Revert "Added snapshots"

This reverts commit cac6f45.

* Refactor code
PureWeen added a commit that referenced this pull request Jun 21, 2025
For more information about inflight process check
https://github.com/dotnet/maui/wiki/Inflight-Branch-Process

# .NET MAUI Release Notes - inflight/candidate Branch

## MAUI Product Fixes
* [iOS] Fix SwipeView programmatic open when background color is set by
@Shalini-Ashokan in #29765
* [iOS] FormattedText with text color causes stack overflow - fix by
@kubaflo in #29874
* [iOS] Fix AdaptiveTrigger not working as expected by @jsuarezruiz in
#20987
* [iOS] Fix for Flyout title is not broken over multiple lines when you
rotate your screen by @BagavathiPerumal in
#29171
* [Windows] Fix for Assigning null to the SelectedItem of the
CollectionView in the SelectionChanged event does not clear the
selection by @SyedAbdulAzeemSF4852 in
#29288
* Fix TapCoordinates method in Catalyst by @jsuarezruiz in
#29775
* Fixed ItemSpacing on CarouselView resizes items [Android] by
@Dhivya-SF4094 in #29796
* Perf : ButtonContentTypeConverter now using InvariantCulture to parse
double by @antoine-jonathan in #25393
* ToolbarItem behavior with ImageSource iOS - fix by @kubaflo in
#28833
* [Android] Fixed Button Shadow Color Transparency Not Applied Correctly
by @NanthiniMahalingam in #29371
* Don't call NSAttributedString with HTML from a background thread by
@kubaflo in #26153
* [Windows] Implemented the Resize and Downsize functions in the
W2DImage class by @HarishwaranVijayakumar in
#29138
* Templated indicator view - improvements by @kubaflo in
#25642
* Update Issue25946.xaml by @anandhan-rajagopal in
#30025

## Testing
* Fixed Test case failure in PR 26153 - iOS by @kubaflo in
#29906
* Fixed Test case failure in PR 25642 - snapshots by @kubaflo in
#29881
* [Testing] Feature Matrix UITest Cases for RadioButton by
@TamilarasanSF4853 in #29744
* [Testing] Feature Matrix UITest Cases for CollectionView ItemsSource
Feature by @LogishaSelvarajSF4525 in
#29322
* [Testing] Feature Matrix UITest Cases for Stepper by
@nivetha-nagalingam in #29731
* [Testing] Feature Matrix UITest Cases for CheckBox Control by
@anandhan-rajagopal in #29739
* Update the comment for the test properties by @mattleibow in
#27306

## Dependency Updates
* No changes in this category

## Docs
* No changes in this category

## Housekeeping
* [create-pull-request] automated change by @github-actions[bot] in
#29875
* [create-pull-request] automated change by @github-actions[bot] in
#29792
* [create-pull-request] automated change by @github-actions[bot] in
#29760

**Full Changelog**:
origin/main...origin/inflight/candidate
@PureWeen PureWeen added this to the .NET 9 SR9 milestone Jun 23, 2025
rmarinho pushed a commit that referenced this pull request Jun 24, 2025
…ge class (#29138)

* Fix for GraphicsView ImagePaint

* update for the graphics view imagePaint

* Added testcase

* Implementation for Downsize

* Revert "Added testcase"

This reverts commit ef22fa8.

* Added test case

* Added CreateResizedMethod

* Implemented Resize method

* Fix modification

* Added testcase

* Revert "Added test case"

This reverts commit a79de0d.

* Updated the changes

* Update changes

* Updated the testcase

* Commited the changes

* Updating code

* Update TestCase

* Code Update

* Modify TestCase

* TestCase Updation

* Code update

* Adding Snapshots

* Added snapshots

* Revert "Added snapshots"

This reverts commit cac6f45.

* Refactor code
NanthiniMahalingam pushed a commit to NanthiniMahalingam/maui that referenced this pull request Jun 27, 2025
…ge class (dotnet#29138)

* Fix for GraphicsView ImagePaint

* update for the graphics view imagePaint

* Added testcase

* Implementation for Downsize

* Revert "Added testcase"

This reverts commit ef22fa8.

* Added test case

* Added CreateResizedMethod

* Implemented Resize method

* Fix modification

* Added testcase

* Revert "Added test case"

This reverts commit a79de0d.

* Updated the changes

* Update changes

* Updated the testcase

* Commited the changes

* Updating code

* Update TestCase

* Code Update

* Modify TestCase

* TestCase Updation

* Code update

* Adding Snapshots

* Added snapshots

* Revert "Added snapshots"

This reverts commit cac6f45.

* Refactor code
@github-actions github-actions bot locked and limited conversation to collaborators Jul 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resize and Downsize function in W2DImage class is not implemented on windows

4 participants