C# Class TileIconifier.Core.Utilities.ImageUtils

ファイルを表示 Open project: Jonno12345/TileIconifier

Public Methods

Method 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 method

public static BitmapsAreEqual ( Bitmap image1, Bitmap image2 ) : bool
image1 System.Drawing.Bitmap
image2 System.Drawing.Bitmap
return bool

ByteArrayToImage() public static method

public static ByteArrayToImage ( byte bytesIn ) : Image
bytesIn byte
return Image

ConvertToIcon() public static method

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
return void

GetScaledWidthAndHeight() public static method

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

ImageToByteArray() public static method

public static ImageToByteArray ( Image imageIn ) : byte[]
imageIn Image
return byte[]

LoadFileToBitmap() public static method

public static LoadFileToBitmap ( string path ) : Bitmap
path string
return System.Drawing.Bitmap

LoadFileToByteArray() public static method

public static LoadFileToByteArray ( string path ) : byte[]
path string
return byte[]

ResizeImage() public static method

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

ScaleImage() public static method

public static ScaleImage ( Image image, int maxWidth, int maxHeight ) : Image
image Image
maxWidth int
maxHeight int
return Image