SpaceVIL
Static Public Member Functions | List of all members
SpaceVIL.GraphicsMathService Class Reference

Class with some functions for constructing custom figures More...

Static Public Member Functions

static Color MixColors (params Color[] m_colors)
 Mix two or more colors More...
 
static List< float[]> GetRectangle (float w=100, float h=100, float x=0, float y=0)
 Make rectangle as two triangles by its width, height and top left corner position (x, y) More...
 
static List< float[]> GetRoundSquare (CornerRadius cornerRadius, float width=100, float height=100, int x=0, int y=0)
 Make a rectangle with roundness corners More...
 
static List< float[]> GetRoundSquare (float width=100, float height=100, float radius=0.0f, int x=0, int y=0)
 Make a rectangle with roundness corners More...
 
static List< float[]> GetStar (float R=100, float r=50, int n=5)
 Make a star figure More...
 
static List< float[]> GetRegularPolygon (float r=100, int n=6)
 Make a regular polygon More...
 
static List< float[]> GetEllipse (float r=100, int n=32)
 Make an ellipse with two equal radii (i. e. circle) More...
 
static List< float[]> GetEllipse (float w, float h, int x=0, int y=0, int n=32)
 Make an ellipse More...
 
static List< float[]> GetTriangle (float w=100, float h=100, int x=0, int y=0, int a=0)
 Make a triangle with corners in (x + w/2, y), (x, y + h), (x + w, y + h), rotated on a degrees More...
 
static List< float[]> GetCross (float w, float h, float thickness, int alpha)
 Make cross figure More...
 
static List< float[]> RotateShape (float w, float h, float angle, List< float[]> triangles)
 
static List< float[]> GetArrow (float w, float h, float thickness, int alpha)
 
static List< float[]> MoveShape (List< float[]> shape, float x, float y)
 Move shape by X or/and Y direction More...
 
static List< float[]> GetFolderIconShape (float w=20.0f, float h=15.0f, float x=0, float y=0)
 Make folder icon shape as three rectangles More...
 
static List< float[]> GetRoundSquareBorder (float width, float height, float radius, float thickness, int x, int y)
 Make a rectangle border with roundness corners More...
 
static List< float[]> GetRoundSquareBorder (CornerRadius cornerRadius, float width, float height, float thickness, int x, int y)
 Make a rectangle border with roundness corners More...
 
static Bitmap ScaleBitmap (Bitmap img, int w, int h)
 
static Color ColorTransform (int r, int g, int b)
 
static Color ColorTransform (int r, int g, int b, int a)
 
static Color ColorTransform (float r, float g, float b)
 
static Color ColorTransform (float r, float g, float b, float a)
 
static Font ChangeFontSize (int size, Font oldFont)
 
static Font ChangeFontStyle (FontStyle style, Font oldFont)
 
static Font ChangeFontFamily (FontFamily fontFamily, Font oldFont)
 

Detailed Description

Class with some functions for constructing custom figures

Member Function Documentation

◆ GetCross()

static List<float[]> SpaceVIL.GraphicsMathService.GetCross ( float  w,
float  h,
float  thickness,
int  alpha 
)
static

Make cross figure

Parameters
wcross width
hcross height
thicknesscross parts thickness
alphacross rotation angle in degrees

◆ GetEllipse() [1/2]

static List<float[]> SpaceVIL.GraphicsMathService.GetEllipse ( float  r = 100,
int  n = 32 
)
static

Make an ellipse with two equal radii (i. e. circle)

Parameters
npoints count on the ellipse border (default = 32)

◆ GetEllipse() [2/2]

static List<float[]> SpaceVIL.GraphicsMathService.GetEllipse ( float  w,
float  h,
int  x = 0,
int  y = 0,
int  n = 32 
)
static

Make an ellipse

Parameters
wellipse width
hellipse height
xX position of the left top corner (ellipse center in x + w/2) (default = 0)
yY position of the left top corner (ellipse center in y + h/2) (default = 0)
npoints count on the ellipse border (default = 32)

◆ GetFolderIconShape()

static List<float[]> SpaceVIL.GraphicsMathService.GetFolderIconShape ( float  w = 20.0f,
float  h = 15.0f,
float  x = 0,
float  y = 0 
)
static

Make folder icon shape as three rectangles

◆ GetRectangle()

static List<float[]> SpaceVIL.GraphicsMathService.GetRectangle ( float  w = 100,
float  h = 100,
float  x = 0,
float  y = 0 
)
static

Make rectangle as two triangles by its width, height and top left corner position (x, y)

◆ GetRegularPolygon()

static List<float[]> SpaceVIL.GraphicsMathService.GetRegularPolygon ( float  r = 100,
int  n = 6 
)
static

Make a regular polygon

◆ GetRoundSquare() [1/2]

static List<float[]> SpaceVIL.GraphicsMathService.GetRoundSquare ( CornerRadius  cornerRadius,
float  width = 100,
float  height = 100,
int  x = 0,
int  y = 0 
)
static

Make a rectangle with roundness corners

Parameters
cornerRadiusradius values for all corners
widthrectangle width (default = 100)
heightrectangle height (default = 100)
xX position (left top corner) of the result object (default = 0)
yY position (left top corner) of the result object (default = 0)
Returns
Points list of the rectangle with roundness corners

◆ GetRoundSquare() [2/2]

static List<float[]> SpaceVIL.GraphicsMathService.GetRoundSquare ( float  width = 100,
float  height = 100,
float  radius = 0.0f,
int  x = 0,
int  y = 0 
)
static

Make a rectangle with roundness corners

Parameters
widthrectangle width (default = 100)
heightrectangle height (default = 100)
radiussame radius value for each corner (default = 0)
xX position (left top corner) of the result object (default = 0)
yY position (left top corner) of the result object (default = 0)
Returns
Points list of the rectangle with roundness corners

◆ GetRoundSquareBorder() [1/2]

static List<float[]> SpaceVIL.GraphicsMathService.GetRoundSquareBorder ( float  width,
float  height,
float  radius,
float  thickness,
int  x,
int  y 
)
static

Make a rectangle border with roundness corners

Parameters
widthrectangle border width
heightrectangle border height
radiussame radius value for each corner
thicknessborder thickness
xX position (left top corner) of the result object
yY position (left top corner) of the result object
Returns
Points list of the rectangle border with roundness corners

◆ GetRoundSquareBorder() [2/2]

static List<float[]> SpaceVIL.GraphicsMathService.GetRoundSquareBorder ( CornerRadius  cornerRadius,
float  width,
float  height,
float  thickness,
int  x,
int  y 
)
static

Make a rectangle border with roundness corners

Parameters
cornerRadiusradius values for all corners
widthrectangle border width
heightrectangle border height
thicknessborder thickness
xX position (left top corner) of the result object
yY position (left top corner) of the result object
Returns
Points list of the rectangle border with roundness corners

◆ GetStar()

static List<float[]> SpaceVIL.GraphicsMathService.GetStar ( float  R = 100,
float  r = 50,
int  n = 5 
)
static

Make a star figure

Parameters
RCircumscribed circle radius
rIncircle radius
nvertices count

◆ GetTriangle()

static List<float[]> SpaceVIL.GraphicsMathService.GetTriangle ( float  w = 100,
float  h = 100,
int  x = 0,
int  y = 0,
int  a = 0 
)
static

Make a triangle with corners in (x + w/2, y), (x, y + h), (x + w, y + h), rotated on a degrees

Parameters
arotation angle for the triangle in degrees (default = 0)

◆ MixColors()

static Color SpaceVIL.GraphicsMathService.MixColors ( params Color []  m_colors)
static

Mix two or more colors

◆ MoveShape()

static List<float[]> SpaceVIL.GraphicsMathService.MoveShape ( List< float[]>  shape,
float  x,
float  y 
)
static

Move shape by X or/and Y direction


The documentation for this class was generated from the following file: