Search Results for

    Show / Hide Table of Contents

    Class Point

    Represents an ordered pair of double x- and y-coordinates that defines a point in a two-dimensional plane.

    Inheritance
    System.Object
    Point
    Namespace: IronSoftware.Drawing
    Assembly: IronSoftware.Drawing.Common.dll
    Syntax
    public class Point : Object

    Pixel-precise coordinate work in C# gets a cross-library anchor through Point, a lightweight record that holds an integer X and Y pair representing a location in a two-dimensional plane. Because IronDrawing targets cross-platform compatibility, Point ships with a full set of implicit conversion operators so the same value flows into SkiaSharp (SKPointI), System.Drawing (System.Drawing.Point), and other coordinate types without explicit casting.

    Construct a value with new Point(int x, int y). The two settable properties, X and Y, expose the horizontal and vertical components directly and can be reassigned after construction. When you need to shift a point relative to its current position, Offset(int dx, int dy) adds the deltas in place, which is cleaner than constructing a replacement. Equals and GetHashCode are overridden so Point values compare by coordinate rather than by reference, making them safe to use in dictionaries and hash sets.

    The implicit operators are the feature that earns Point its role as a hub type. Assignments and method arguments that expect a System.Drawing.Point, a SKPointI, or one of the other supported coordinate types accept a Point directly, and the reverse conversions are also defined. This means code that mixes IronDrawing with SkiaSharp or with System.Drawing does not need adapter layers or manual unpacking.

    A common pattern is to read coordinates from a cropping rectangle or a detected region, adjust them with Offset, and then pass the result straight to a rendering or layout API that expects a different point type:

    using IronSoftware.Drawing;
    
    var origin = new Point(120, 80);
    origin.Offset(10, -5);
    
    // Implicit conversion: no cast needed when the target API expects SKPointI
    SKPointI skPoint = origin;
    Console.WriteLine($"SKPointI: {skPoint.X}, {skPoint.Y}");

    The IronDrawing get-started guide covers installation and setup. The coordinate types overview explains how Point, Rectangle, and Color relate to each other. For practical usage patterns, the cross-library interop examples show implicit conversions in action.

    Constructors

    Point(Int32, Int32)

    Initializes a new instance of the Point struct with the specified coordinates.

    Declaration
    public Point(int x, int y)
    Parameters
    Type Name Description
    System.Int32 x
    System.Int32 y

    Properties

    X

    Gets or sets the x-coordinate of this Point.

    Declaration
    public int X { get; set; }
    Property Value
    Type Description
    System.Int32

    Y

    Gets or sets the y-coordinate of this Point.

    Declaration
    public int Y { get; set; }
    Property Value
    Type Description
    System.Int32

    Methods

    Equals(Object)

    Specifies whether this Point instance contains the same coordinates as another Point.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj

    The point to test for equality.

    Returns
    Type Description
    System.Boolean

    true if other has the same coordinates as this point instance.

    GetHashCode()

    Hashing integer based on image raw binary data.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    Int

    Offset(Int32, Int32)

    Translates this Point by the specified amount.

    Declaration
    public void Offset(int dx, int dy)
    Parameters
    Type Name Description
    System.Int32 dx

    The amount to offset the x-coordinate.

    System.Int32 dy

    The amount to offset the y-coordinate.

    Operators

    Implicit(Point to Point)

    Implicitly casts Point objects to Microsoft.Maui.Graphics.Point

    Declaration
    public static implicit operator Point(Point point)
    Parameters
    Type Name Description
    Point point

    Point will automatically be casted to Microsoft.Maui.Graphics.Point

    Returns
    Type Description
    Microsoft.Maui.Graphics.Point

    Implicit(Point to Point)

    Implicitly casts Point objects to SixLabors.ImageSharp.Point

    Declaration
    public static implicit operator Point(Point point)
    Parameters
    Type Name Description
    Point point

    Point will automatically be casted to SixLabors.ImageSharp.Point

    Returns
    Type Description
    SixLabors.ImageSharp.Point

    Implicit(Point to SKPointI)

    Implicitly casts Point objects to SkiaSharp.SKPointI

    Declaration
    public static implicit operator SKPointI(Point point)
    Parameters
    Type Name Description
    Point point

    Point will automatically be casted to SkiaSharp.SKPointI

    Returns
    Type Description
    SkiaSharp.SKPointI

    Implicit(Point to Point)

    Implicitly casts Point objects to System.Drawing.Point

    Declaration
    public static implicit operator Point(Point point)
    Parameters
    Type Name Description
    Point point

    Point will automatically be casted to System.Drawing.Point

    Returns
    Type Description
    System.Drawing.Point

    Implicit(Point to Point)

    Implicitly casts Microsoft.Maui.Graphics.Point objects to Point.

    Declaration
    public static implicit operator Point(Point point)
    Parameters
    Type Name Description
    Microsoft.Maui.Graphics.Point point

    Microsoft.Maui.Graphics.Point will automatically be casted to Point

    Returns
    Type Description
    Point

    Implicit(Point to Point)

    Implicitly casts SixLabors.ImageSharp.Point objects to Point

    Declaration
    public static implicit operator Point(Point point)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.Point point

    System.Drawing.Point will automatically be casted to Point

    Returns
    Type Description
    Point

    Implicit(SKPointI to Point)

    Implicitly casts SkiaSharp.SKPointI objects to Point.

    Declaration
    public static implicit operator Point(SKPointI point)
    Parameters
    Type Name Description
    SkiaSharp.SKPointI point

    SkiaSharp.SKPointI will automatically be casted to Point

    Returns
    Type Description
    Point

    Implicit(Point to Point)

    Implicitly casts System.Drawing.Point objects to Point.

    Declaration
    public static implicit operator Point(Point point)
    Parameters
    Type Name Description
    System.Drawing.Point point

    System.Drawing.Point will automatically be casted to Point

    Returns
    Type Description
    Point
    ☀
    ☾
    Downloads
    • Download with Nuget
    In This Article
    Back to top
    Install with Nuget
    IronDrawing_for_dotnet_log2o
    Blue key in circleGet started for FREE
    No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet started for FREE
    The trial form was submitted successfully.
    Calendar in circleBook Free Live Demo
    No contact, no card details, no commitments Book a 30-minute, personal demo.
    Here's what to expect:

    A live demo of our product and its key features

    Get project specific feature recommendations

    All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation
    Support Team Member 6 related to The C# PDF Library Support Team Member 14 related to The C# PDF Library Support Team Member 4 related to The C# PDF Library Support Team Member 2 related to The C# PDF Library
    Online 24/5
    Need help? Our sales team would be glad to help you.
    Try the Enterprise Trial
    ironpdf_for_dotnet_log2o
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    bullet_checkedNo credit card or account creation required
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    Blue key in circleNo credit card or account creation required
    Green Check in orange circle
    The trial form was submitted successfully.
    badge_greencheck_in_yellowcircle
    Thank you for starting a trial

    Please check your email for the trial license key.

    If you don’t receive an email, please start a live chat or email support@ironsoftware.com

    Install with NuGet
    View Licensing
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronDrawing