Bug 44127 - GdipCloneBitmapArea loses the resolution
Summary: GdipCloneBitmapArea loses the resolution
Alias: None
Product: Class Libraries
Classification: Mono
Component: libgdiplus ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2016-09-08 20:27 UTC by Stephen McConnel
Modified: 2017-04-30 17:51 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Stephen McConnel 2016-09-08 20:27:49 UTC
A Bitmap object created by the Bitmap.Clone method, which uses GdipCloneBitmapArea (or GdipCloneBitmapAreaI) underneath, ends up with a horizontal and vertical resolution of 0.  Testing this operation on Windows/.Net, the cloned object should have the same resolution as the original object.  The MSDN documentation is silent here, but both PNG and JPEG images were observed to return a cloned Bitmap object with its horizontal and vertical resolution values the same as those in the original Bitmap object.

This is true of both version 3.4 and 4.4.  I expect it's still true on the trunk.
Comment 1 Stephen McConnel 2016-09-08 22:17:01 UTC
https://github.com/mono/libgdiplus/pull/41 is my proposed fix for this bug.
Comment 2 Alexander Köplinger [MSFT] 2017-04-30 17:51:26 UTC
I merged the PR, thank you!