Gorgon
Show / Hide Table of Contents

Class RectClipperService

A service used to clip a rectangular area from an image.

Inheritance
object
RectClipperService
Implements
IRectClipperService
IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Editor.Services
Assembly: Gorgon.Editor.API.dll
Syntax
public class RectClipperService : IRectClipperService, IDisposable

Constructors

| Edit this page View Source

RectClipperService(Gorgon2D, IMarchingAnts)

Initializes a new instance of the RectClipperService class.

Declaration
public RectClipperService(Gorgon2D renderer, IMarchingAnts marchingAnts)
Parameters
Type Name Description
Gorgon2D renderer

The 2D renderer for the application.

IMarchingAnts marchingAnts

The marching ants rectangle used to display the selection region.

Properties

| Edit this page View Source

AllowManualInput

Property to set or return whether manual input is allowed or not.

Declaration
public bool AllowManualInput { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

AllowMove

Property to set or return whether the selection can be moved.

Declaration
public bool AllowMove { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

AllowResize

Property to set or return whether resizing is allowed.

Declaration
public bool AllowResize { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

Bounds

Property to set or return the boundaries for the clipping rectangle.

Declaration
public RectangleF Bounds { get; set; }
Property Value
Type Description
RectangleF
| Edit this page View Source

Camera

Property to set or return the camera being used.

Declaration
public GorgonOrthoCamera Camera { get; set; }
Property Value
Type Description
GorgonOrthoCamera
| Edit this page View Source

ClipAgainstBoundaries

Property to set or return whether to clip the rectangle against the boundaries provided by Bounds.

Declaration
public bool ClipAgainstBoundaries { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

IsDragging

Property to return whether we're in the middle of a drag operation or not.

Declaration
public bool IsDragging { get; }
Property Value
Type Description
bool
| Edit this page View Source

Rectangle

Property to return the rectangular region marked for clipping.

Declaration
public RectangleF Rectangle { get; set; }
Property Value
Type Description
RectangleF
| Edit this page View Source

ShowManualInput

Property to set or return whether to show the manual input icon.

Declaration
public bool ShowManualInput { get; set; }
Property Value
Type Description
bool

Methods

| Edit this page View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
| Edit this page View Source

KeyDown(Keys, Keys)

Function called when a key is held down.

Declaration
public bool KeyDown(Keys key, Keys modifiers)
Parameters
Type Name Description
Keys key

The key that was held down.

Keys modifiers

The modifier keys held down with the key.

Returns
Type Description
bool

true if the key was handled, false if it was not.

| Edit this page View Source

MouseDown(MouseArgs)

Function called when the mouse button is pressed.

Declaration
public bool MouseDown(MouseArgs mouseArgs)
Parameters
Type Name Description
MouseArgs mouseArgs

The arguments for the mouse events.

Returns
Type Description
bool

true if the mouse event was handled, false if it was not.

| Edit this page View Source

MouseMove(MouseArgs)

Function called when the mouse button is moved.

Declaration
public bool MouseMove(MouseArgs mouseArgs)
Parameters
Type Name Description
MouseArgs mouseArgs

The arguments for the mouse events.

Returns
Type Description
bool

true if the mouse event was handled, false if it was not.

| Edit this page View Source

MouseUp(MouseArgs)

Function called when the mouse button is released.

Declaration
public bool MouseUp(MouseArgs mouseArgs)
Parameters
Type Name Description
MouseArgs mouseArgs

The arguments for the mouse events.

Returns
Type Description
bool

true if the mouse event was handled, false if it was not.

| Edit this page View Source

Refresh()

Function to force a refresh of the service.

Declaration
public void Refresh()
| Edit this page View Source

Render()

Function to render the clipping region.

Declaration
public void Render()

Events

| Edit this page View Source

KeyboardIconClicked

Event triggered when the keyboard icon is clicked.

Declaration
public event EventHandler KeyboardIconClicked
Event Type
Type Description
EventHandler
| Edit this page View Source

RectChanged

Event triggered when the rectangle coordinates have been altered.

Declaration
public event EventHandler RectChanged
Event Type
Type Description
EventHandler

Implements

IRectClipperService
IDisposable

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author