change UI to UI.WinForms
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Pilz.UI.WinForms.PaintingControl.EventArgs;
|
||||
|
||||
public class PaintingObjectPaintEventArgs(PaintingObject obj, Graphics g, PointF offset) : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The Painting Object to draw.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public PaintingObject PaintingObject { get; } = obj;
|
||||
|
||||
/// <summary>
|
||||
/// The current offset of the page on the screen.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public PointF Offset { get; } = offset;
|
||||
|
||||
/// <summary>
|
||||
/// The Grpahics from the parent PaintingControl.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Graphics Graphics { get; } = g;
|
||||
|
||||
/// <summary>
|
||||
/// The position of the PaintingObject on Screen.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public PointF Location => new(X, Y);
|
||||
|
||||
/// <summary>
|
||||
/// The X position of the PaintingObject on Screen.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public float X => PaintingObject.X - Offset.X;
|
||||
|
||||
/// <summary>
|
||||
/// The Y position of the PaintingObject on Screen.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public float Y => PaintingObject.Y - Offset.Y;
|
||||
|
||||
/// <summary>
|
||||
/// The rectangle of the PaintingObject on Screen.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public RectangleF Rectangle => new RectangleF(X, Y, PaintingObject.Width, PaintingObject.Height);
|
||||
|
||||
public PaintingObjectPaintEventArgs(PaintingObject obj, Graphics g) : this(obj, g, obj.Parent.Offset)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user