Class Extensions
Extensions for converting values between relative and scaled.
Inherited Members
Namespace: LemonUI.Tools
Assembly: LemonUI.SHVDN3.dll
Syntax
public static class Extensions
Methods
View SourceToRelative(PointF)
Converts a scaled 1080p-based position into a relative one.
Declaration
public static PointF ToRelative(this PointF point)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The scaled PointF. |
Returns
| Type | Description |
|---|---|
| PointF | A new PointF with relative values. |
ToRelative(SizeF)
Converts a scaled 1080p-based position into a relative one.
Declaration
public static SizeF ToRelative(this SizeF size)
Parameters
| Type | Name | Description |
|---|---|---|
| SizeF | size | The scaled SizeF. |
Returns
| Type | Description |
|---|---|
| SizeF | A new SizeF with relative values. |
ToScaled(PointF)
Converts a relative 0-1 position into a scaled one.
Declaration
public static PointF ToScaled(this PointF point)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The relative PointF. |
Returns
| Type | Description |
|---|---|
| PointF | A new PointF with scaled values. |
ToScaled(SizeF)
Converts a relative 0-1 position into a scaled one.
Declaration
public static SizeF ToScaled(this SizeF size)
Parameters
| Type | Name | Description |
|---|---|---|
| SizeF | size | The relative SizeF. |
Returns
| Type | Description |
|---|---|
| SizeF | A new SizeF with scaled values. |
ToXRelative(float)
Converts the scaled X or Width to a relative one.
Declaration
public static float ToXRelative(this float x)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The value to convert. |
Returns
| Type | Description |
|---|---|
| float | A relative float between 0 and 1. |
ToXScaled(float)
Converts the relative X or Width float to a scaled one.
Declaration
public static float ToXScaled(this float x)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The float to convert. |
Returns
| Type | Description |
|---|---|
| float | A scaled float. |
ToYRelative(float)
Converts the scaled Y or Height to a relative one.
Declaration
public static float ToYRelative(this float y)
Parameters
| Type | Name | Description |
|---|---|---|
| float | y | The value to convert. |
Returns
| Type | Description |
|---|---|
| float | A relative float between 0 and 1. |
ToYScaled(float)
Converts the relative Y or Height float to a scaled one.
Declaration
public static float ToYScaled(this float y)
Parameters
| Type | Name | Description |
|---|---|---|
| float | y | The float to convert. |
Returns
| Type | Description |
|---|---|
| float | A scaled float. |