Beispiel #1
0
 public Bitmap Apply(Bitmap bitmap, int scale)
 {
     if (scale == 1)
     {
         bitmap = hqx.HqxSharp.Scale2(bitmap, 48, 7, 6, 0, true, true);
         bitmap = ImagesHelper.ResizeImage(bitmap, 0.5f);
     }
     if (scale == 2)
     {
         bitmap = hqx.HqxSharp.Scale2(bitmap, 48, 7, 6, 0, true, true);
     }
     else if (scale == 3)
     {
         bitmap = hqx.HqxSharp.Scale3(bitmap, 48, 7, 6, 0, true, true);
     }
     else if (scale == 4)
     {
         bitmap = hqx.HqxSharp.Scale4(bitmap, 48, 7, 6, 0, true, true);
     }
     else if (scale > 4)
     {
         throw new ArgumentException("Smoothing can be used with scale from 1 to 4");
     }
     return(bitmap);
 }
Beispiel #2
0
        public Bitmap Apply(Bitmap bitmap, int scale)
        {
            Initialize();
            var resizedImage       = ImagesHelper.ResizeImage(bitmap, 8);
            var repeatedEmbroidery = ImagesHelper.RepeatToFitSize(embroidery, resizedImage.Width, resizedImage.Height);
            var result             = ImagesHelper.MergeBitmaps(repeatedEmbroidery, resizedImage);

            return(result);
        }
Beispiel #3
0
        public Bitmap Apply(Bitmap bitmap, int scale)
        {
            Initialize();
            var resizedImage  = ImagesHelper.ResizeImage(bitmap, 8);
            var darkenImage   = ImagesHelper.Adjust(resizedImage, 0.4f, 1, 1);
            var repeatedTiles = ImagesHelper.RepeatToFitSize(tiles, resizedImage.Width, resizedImage.Height);
            var repeatedMask  = ImagesHelper.RepeatToFitSize(mask, resizedImage.Width, resizedImage.Height);
            var darkenLayer   = ImagesHelper.ApplyAlphaMask(darkenImage, repeatedMask);
            var result        = ImagesHelper.MergeBitmaps(darkenLayer, repeatedTiles, resizedImage);

            return(result);
        }
Beispiel #4
0
 public Bitmap Apply(Bitmap bitmap, int scale)
 {
     return(ImagesHelper.ResizeImage(bitmap, scale));
 }