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
    %s requires a valid license key for further deployment. Get Trial Below.
    ironsuite
    Blue key in circleGet Started for Free
    30 days full access • 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.
    Grey check in circleTrial key delivered
    Your key has been issued and sent to your email.
    Calendar in circleBook Free Live Demo
    No cards • no pitches • no commitments Pick a time for a quick, personalized demo
    Get the most out of your 30-day trial with:

    Live product and key features walk-through

    Project-specific recommendations

    All your questions answered

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation

    Want to deploy Iron Suite
    to a live project for FREE?

    What’s included?

    • Test in production without watermarks
    • 30 days fully functional product
    • 24/5 technical support during trial
    ironpdf Logo
    ironword Logo
    ironxl Logo
    ironppt Logo
    ironocr Logo
    ironbarcode Logo
    ironqr Logo
    ironprint Logo
    ironzip Logo
    ironwebscraper Logo
    Iron Software sales team
    Online 24/5
    Have Enterprise licensing requirements?
    Request Iron Suite Enterprise trial
    Key in blue circle

    Get your free 30-day Trial Key instantly

    Your trial license will be sent to your email address

    No limitations. 100% unlocked. No credit card.

    bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
    Or
    Key in blue circle

    Complete Your Trial Key Signup

    Tell us a little more about yourself.

    Key in blue circleNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
    Key in blue circle

    Your license key has been delivered to your inbox

    Can't find it? Check your spam folder.

    What’s next?
    Install with NuGet
    Add IronDrawing to your project
    Quickstart Guide
    Helpful resources to get started

    Need help getting started?

    Book a Free Live Demo

    See IronDrawing in action and get your licensing questions answered, or

    Key in blue circle

    Your demo request is in.

    You'll receive an invite via email shortly.

    What’s next?
    Explore Documentation
    Review Licensing Options
    badge_greencheck_in_yellowcircle
    Thank you
    Your trial key should be in the email.
    If it is not, please contact support@ironsoftware.com
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronDrawing
    Your trial key should be in the email.
    If it is not, please contact support@ironsoftware.com