I am looking for a function where i will send point and function return inches in values. please share sample code. thanks
I am looking for a function where i will send point and function return inches in values. please share sample code. thanks
What is a point in your application? A point found on a graph? A point on a map. font point? A point in an image?
Assuming this is a font question, 72 points is one inch. Mathematically the conversion factor is (1in /72 pt). To solve for inches just multiple point by 1/72 or 0.01388.
float PointsToInches(float points) {
return points / 72F;
}
Usage:
var inches = PointsToInches(10);
To convert 10 points to inches.
what is 72F ? f means here float ?
if i do not use 72F rather use points / 72; then i will get wrong output ?
thanks
Correct - 'f' denotes that it's a floating point number rather than an integer. When you perform an arithmetic operation in C#, if the number on either side of the expression is a float then the result is a float. You could use '72' instead of '72F' in this case because 'points' is a float, but I just wanted to make it clear that this is a floating point operation.
7 people are following this question.
Insert a node as child ,before or after a node in nested dynamic JSON Node using C#
Visual Studio 2019: Undefined behavior in a C++/CLI wrapper project.
Example for how to get Package Metadata from Azure DevOps Rest-Api Artifacts using c#
How to collapse individual nested grids/stackpanels inside a grid?