Exemple #1
0
        private static Bitmap DoKaruta13(Bitmap wtex, Bitmap utex)
        {
            // this is very messy but the dimensions just don't match between versions
            // we should probably just inject a differently sized texture instead, really...
            Bitmap cropped1   = FontProcessing.Crop(utex, 10, 4, utex.Width - 24, utex.Height - 5);
            Bitmap upscaled   = FontProcessing.PointScale(cropped1, 6);
            Bitmap cropped2   = FontProcessing.Crop(upscaled, 0, 1, upscaled.Width, upscaled.Height - 1);
            Bitmap downscaled = FontProcessing.DownscaleInteger(cropped2, 11);

            return(DoCropExpandCanvas(downscaled, (uint)wtex.Width, (uint)wtex.Height));
        }
Exemple #2
0
        private static Bitmap DoKarutaHalfAndHalf(Bitmap wtex, Bitmap utex, uint wx, uint ux, uint uw)
        {
            Bitmap left  = FontProcessing.Crop(wtex, 0, 0, (int)wx, wtex.Height);
            Bitmap right = DownscaleTwoThirds(FontProcessing.Crop(utex, (int)ux, 0, (int)uw, utex.Height));
            long   diff  = wtex.Width - (left.Width + right.Width);

            if (diff > 0)
            {
                Bitmap mid = new Bitmap((int)diff, wtex.Height);
                for (int y = 0; y < mid.Height; ++y)
                {
                    for (int x = 0; x < mid.Width; ++x)
                    {
                        mid.SetPixel(x, y, Color.FromArgb(0, 0, 0, 0));
                    }
                }
                left = StitchHorizontal(left, mid);
            }
            return(StitchHorizontal(left, right));
        }