C# Class TileIconifier.Core.Utilities.ImageUtils

Afficher le fichier Open project: Jonno12345/TileIconifier

Méthodes publiques

Méthode Description
BitmapsAreEqual ( Bitmap image1, Bitmap image2 ) : bool
ByteArrayToImage ( byte bytesIn ) : Image
ConvertToIcon ( Image input, Stream output, int size = 16, bool preserveAspectRatio = true ) : void

Converts a PNG image to a icon (ico)

GetScaledWidthAndHeight ( int curWidth, int curHeight, int maxWidth, int maxHeight ) : Size
ImageToByteArray ( Image imageIn ) : byte[]
LoadFileToBitmap ( string path ) : Bitmap
LoadFileToByteArray ( string path ) : byte[]
ResizeImage ( Image image, int width, int height ) : Bitmap
ScaleImage ( Image image, int maxWidth, int maxHeight ) : Image

Method Details

BitmapsAreEqual() public static méthode

public static BitmapsAreEqual ( Bitmap image1, Bitmap image2 ) : bool
image1 System.Drawing.Bitmap
image2 System.Drawing.Bitmap
Résultat bool

ByteArrayToImage() public static méthode

public static ByteArrayToImage ( byte bytesIn ) : Image
bytesIn byte
Résultat Image

ConvertToIcon() public static méthode

Converts a PNG image to a icon (ico)
public static ConvertToIcon ( Image input, Stream output, int size = 16, bool preserveAspectRatio = true ) : void
input Image The input stream
output Stream The output stream
size int The size (16x16 px by default)
preserveAspectRatio bool Preserve the aspect ratio
Résultat void

GetScaledWidthAndHeight() public static méthode

public static GetScaledWidthAndHeight ( int curWidth, int curHeight, int maxWidth, int maxHeight ) : Size
curWidth int
curHeight int
maxWidth int
maxHeight int
Résultat System.Drawing.Size

ImageToByteArray() public static méthode

public static ImageToByteArray ( Image imageIn ) : byte[]
imageIn Image
Résultat byte[]

LoadFileToBitmap() public static méthode

public static LoadFileToBitmap ( string path ) : Bitmap
path string
Résultat System.Drawing.Bitmap

LoadFileToByteArray() public static méthode

public static LoadFileToByteArray ( string path ) : byte[]
path string
Résultat byte[]

ResizeImage() public static méthode

public static ResizeImage ( Image image, int width, int height ) : Bitmap
image Image
width int
height int
Résultat System.Drawing.Bitmap

ScaleImage() public static méthode

public static ScaleImage ( Image image, int maxWidth, int maxHeight ) : Image
image Image
maxWidth int
maxHeight int
Résultat Image