GIFToWoWTexture/GIFConverter/ImageTransforms.cs
/// <summary>
/// Tries to create a square of arrayed images
/// </summary>
Tries to create a square of arrayed images
Tries to create a square of arrayed images
public static Image ArrayImages(List<Image> images)
        {
            (int rows, int columns) RowsAndColumns = CalculateRowsAndColumns(images);
            int wid = RowsAndColumns.columns * images.First().Width;
            int hgt = RowsAndColumns.rows * images.First().Height;
            Bitmap bm = new Bitmap(wid, hgt, PixelFormat.Format32bppArgb);
            bm.MakeTransparent();
            using (Graphics gr = Graphics.FromImage(bm))
            {
                gr.Clear(Color.Transparent);
                int x = 0;
                int y = 0;
                for (int i = 0; i < images.Count; i++)
                {
                    gr.DrawImage(images[i], x, y);
                    x += images.First().Width;
                    if (x >= wid)
                    {
                        y += images.First().Height;
                        x = 0;
                    }
                }
            }
            return bm;
        }
public static Image ArrayImages ( List < Image > images ) { ( int rows , int columns ) RowsAndColumns = CalculateRowsAndColumns ( images ) ; int wid = RowsAndColumns . columns * images . First ( ) . Width ; int hgt = RowsAndColumns . rows * images . First ( ) . Height ; Bitmap bm = new Bitmap ( wid , hgt , PixelFormat . Format32bppArgb ) ; bm . MakeTransparent ( ) ; using ( Graphics gr = Graphics . FromImage ( bm ) ) { gr . Clear ( Color . Transparent ) ; int x = 0 ; int y = 0 ; for ( int i = 0 ; i < images . Count ; i ++ ) { gr . DrawImage ( images [ i ] , x , y ) ; x += images . First ( ) . Width ; if ( x >= wid ) { y += images . First ( ) . Height ; x = 0 ; } } } return bm ; }
Tries to create a square of arrayed images
Tries to create a square of arrayed images
// Place the images on it.
images
List<Image>