예제 #1
0
 private static Bitmap DownscaleTwoThirds(Bitmap img)
 {
     if (((img.Width * 2) % 3) != 0 || ((img.Height * 2) % 3) != 0)
     {
         throw new Exception("Cannot cleanly two-thirds scale image!");
     }
     return(FontProcessing.DownscaleInteger(FontProcessing.PointScale(img, 2), 3));
 }
예제 #2
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));
        }