예제 #1
0
        internal static void SaveWP7Image(CBImageFile image, int width, int height)
        {
            Bitmap newImage = CBImageManager.ResizeImage(image.SourceImage, width, height);
            string fileName = string.Format("{0}\\WP7\\{1}", image.DirectoryName, image.FileName);

            newImage.Save(fileName, ImageFormat.Png);
        }
예제 #2
0
        private static string GetIconName(CBImageFile image, CBImageInfo info)
        {
            string fullName = image.DirectoryName + "\\" +
                              info.DeviceType.ToString() + "\\" + info.FileName;

            return(fullName);
        }
예제 #3
0
        public static void SaveIcon(CBImageFile image, CBImageInfo info)
        {
            Bitmap newImage = CBImageManager.ResizeImage(image.SourceImage, info.Width, info.Height);
            string fileName = GetIconName(image, info);

            newImage.Save(fileName, ImageFormat.Png);
        }
예제 #4
0
 internal static void SaveiOSImage(CBImageFile image, int width, int height)
 {
     // normal image
     Bitmap newImage = CBImageManager.ResizeImage(image.SourceImage, width / 2, height / 2);
     string fileName = string.Format("{0}\\iOS\\{1}", image.DirectoryName,image.FileName);
     newImage.Save(fileName, ImageFormat.Png);
     // retina image
     newImage = CBImageManager.ResizeImage(image.SourceImage, width, height);
     fileName = string.Format("{0}\\iOS\\{1}", image.DirectoryName, image.FileName.Replace(".png","@2x.png"));
     newImage.Save(fileName, ImageFormat.Png);
 }
예제 #5
0
        public static void GenerateImage(string fileName, int width, int height)
        {
            CBImageFile     image         = new CBImageFile(fileName);
            CBDeviceManager deviceManager = new CBDeviceManager();

            deviceManager.CreateAllDeviceDirectory(image.DirectoryName);

            CBImageManager.SaveiOSImage(image, width, height);
            CBImageManager.SaveAndroidImage(image, width, height);
            CBImageManager.SaveWP7Image(image, width, height);
        }
예제 #6
0
        internal static void SaveiOSImage(CBImageFile image, int width, int height)
        {
            // normal image
            Bitmap newImage = CBImageManager.ResizeImage(image.SourceImage, width / 2, height / 2);
            string fileName = string.Format("{0}\\iOS\\{1}", image.DirectoryName, image.FileName);

            newImage.Save(fileName, ImageFormat.Png);
            // retina image
            newImage = CBImageManager.ResizeImage(image.SourceImage, width, height);
            fileName = string.Format("{0}\\iOS\\{1}", image.DirectoryName, image.FileName.Replace(".png", "@2x.png"));
            newImage.Save(fileName, ImageFormat.Png);
        }
예제 #7
0
        public static void GenerateIcons(string directory, string fileName)
        {
            CBDeviceManager deviceManager = new CBDeviceManager();

            deviceManager.CreateAllDeviceDirectory(directory);
            CBImageFile image = new CBImageFile(directory, fileName);
            CBIconInfo  icons = CBIconInfo.GenerateDefault();

            foreach (CBImageInfo info in icons.IconDefines)
            {
                CBImageManager.SaveIcon(image, info);
            }
        }
예제 #8
0
        public static void GenerateImages(string rootImageDirectory, int width, int height)
        {
            CBDeviceManager deviceManager = new CBDeviceManager();

            deviceManager.CreateAllDeviceDirectory(rootImageDirectory);

            string[] files = Directory.GetFiles(rootImageDirectory, "*.png");

            foreach (string fullName in files)
            {
                Debug.WriteLine(fullName);
                CBImageFile image = new CBImageFile(fullName);
                CBImageManager.SaveiOSImage(image, width, height);
                CBImageManager.SaveAndroidImage(image, width, height);
                CBImageManager.SaveWP7Image(image, width, height);
            }
        }
예제 #9
0
        public static void GenerateImages(string rootImageDirectory)
        {
            CBDeviceManager deviceManager = new CBDeviceManager();

            deviceManager.CreateAllDeviceDirectory(rootImageDirectory);

            string[] files = Directory.GetFiles(rootImageDirectory, "*.png");

            foreach (string fullName in files)
            {
                CBImageFile image = new CBImageFile(fullName);
                // v1.2 fix width and height to even
                int width  = image.SourceImage.Width - (image.SourceImage.Width % 2);
                int height = image.SourceImage.Height - (image.SourceImage.Height % 2);
                CBImageManager.SaveiOSImage(image, width, height);
                CBImageManager.SaveAndroidImage(image, width, height);
                CBImageManager.SaveWP7Image(image, width, height);
            }
        }
예제 #10
0
 private static string GetIconName(CBImageFile image, CBImageInfo info)
 {
     string fullName = image.DirectoryName + "\\" +
         info.DeviceType.ToString() + "\\" + info.FileName;
     return fullName;
 }
예제 #11
0
 internal static void SaveWP7Image(CBImageFile image, int width, int height)
 {
     Bitmap newImage = CBImageManager.ResizeImage(image.SourceImage, width, height);
     string fileName = string.Format("{0}\\WP7\\{1}", image.DirectoryName, image.FileName);
     newImage.Save(fileName, ImageFormat.Png);
 }
예제 #12
0
 public static void SaveIcon(CBImageFile image, CBImageInfo info)
 {
     Bitmap newImage = CBImageManager.ResizeImage(image.SourceImage, info.Width, info.Height);
     string fileName = GetIconName(image, info);
     newImage.Save(fileName, ImageFormat.Png);
 }