Gets or sets a value that represents the X coordinate for this
LogicalPoint.
Syntax
Visual Basic (Declaration) | |
---|
Public Property X As Double |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As LogicalPoint
Dim value As Double
instance.X = value
value = instance.X
|
C# | |
---|
public double X {get; set;} |
Return Value
The x-coordinate of this
LogicalPoint.
Example
This example converts the x and y from inch to pixels units.
Visual Basic | Copy Code |
---|
Public Sub LogicalPoint_ConvertedXY()
Dim pt As LogicalPoint = New LogicalPoint(1.5f, 2f, LogicalUnit.Inch)
Dim s As String
s = String.Format("Point is {0}", pt)
MessageBox.Show(s)
s = String.Format("x and y is {0}, {1} Pixels", LogicalUnitConverter.Convert(pt.X, LogicalUnit.Inch, 150, LogicalUnit.Pixel, 150), LogicalUnitConverter.ConvertToPixels(pt.Y, LogicalUnit.Inch, 150))
MessageBox.Show(s)
End Sub |
C# | Copy Code |
---|
public void LogicalPoint_ConvertedXY() { // create a new logical point at location 1.5, 2 in inches LogicalPoint pt = new LogicalPoint(1.5f, 2f, LogicalUnit.Inch); string s; // show the point s = string.Format("Point is {0}", pt); MessageBox.Show(s); // show the x and y components converted to pixels s = string.Format("x and y is {0}, {1} Pixels", LogicalUnitConverter.Convert(pt.X, LogicalUnit.Inch, 150, LogicalUnit.Pixel, 150), LogicalUnitConverter.ConvertToPixels(pt.Y, LogicalUnit.Inch, 150)); MessageBox.Show(s); } |
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also