Bug 14365 - DPIWidth and DPIHeight are returned as integers and not float values
Summary: DPIWidth and DPIHeight are returned as integers and not float values
Status: RESOLVED FIXED
Alias: None
Product: MonoMac
Classification: Desktop
Component: Bindings ()
Version: GIT
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-09-01 00:22 UTC by kjpou1
Modified: 2013-09-05 10:43 UTC (History)
2 users (show)

Tags:
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 Developer Community or GitHub 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:
Status:
RESOLVED FIXED

Description kjpou1 2013-09-01 00:22:32 UTC
Hey everyone

DPIWidth and DPIHeight are returned as integers and not float values in CGImageProperties.

These two really need to be float values.

I have submitted a Pull Request to maccore to fix this.

https://github.com/mono/maccore/pull/57

Modify CGImageProperties to return float value for DPIHeight and DPIWidth instead of integer.
Comment 1 Miguel de Icaza [MSFT] 2013-09-02 14:45:06 UTC
Since we have shipped this API, we should instead introduce an [Obsolete] on them, and then surface a new floating point version of them.
Comment 2 Miguel de Icaza [MSFT] 2013-09-02 14:45:19 UTC
Since we have shipped this API, we should instead introduce an [Obsolete] on them, and then surface a new floating point version of them.
Comment 3 kjpou1 2013-09-02 23:57:55 UTC
Miguel

What would you like for me to rename them to?  I propose an F suffix or is there a naming standard that you would like to follow for this?  

		public float? DPIHeightF {
			get {
				return GetFloatValue (Keys.DPIHeight);
			}
			set {
				SetNumberValue (Keys.DPIHeight, value);
			}
		}

		public float? DPIWidthF {
			get {
				return GetFloatValue (Keys.DPIWidth);
			}
			set {
				SetNumberValue (Keys.DPIWidth, value);
			}
		}

That way they know it is the float value.
Comment 4 Miguel de Icaza [MSFT] 2013-09-03 08:55:55 UTC
Good names!   I like them!
Comment 5 kjpou1 2013-09-03 11:21:32 UTC
Ok done.  They are part of the PR posted earlier.

Thanks
Comment 6 Miguel de Icaza [MSFT] 2013-09-05 10:43:38 UTC
closed