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); }
private static string GetIconName(CBImageFile image, CBImageInfo info) { string fullName = image.DirectoryName + "\\" + info.DeviceType.ToString() + "\\" + info.FileName; return(fullName); }
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); }
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); }
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); }
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); }
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); } }
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); } }
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); } }
private static string GetIconName(CBImageFile image, CBImageInfo info) { string fullName = image.DirectoryName + "\\" + info.DeviceType.ToString() + "\\" + info.FileName; return fullName; }