/// <summary> /// Save a new custom puzzle /// </summary> #if IOS public PuzzleData AddPuzzle(string filename, string owner, MonoTouch.UIKit.UIImage image) { string completeFilePath = System.IO.Path.Combine(mCustomPuzzlePath, filename); Logger.I("Adding a new " + owner + " puzzle " + filename); // Save the new image MonoTouch.Foundation.NSError error; image.AsPNG().Save(completeFilePath, true, out error); if (error == null) { Logger.I("Adding puzzle OK"); } else { Logger.E("Adding puzzle KO: " + error); } PuzzleData newPuzzle = new PuzzleData() { Filename = completeFilePath, IsCustom = true, IsNew = true, OwnerId = owner }; Savedgame.Puzzles.Add(newPuzzle); Save(); return(newPuzzle); }
/// <summary> /// 表示用画像を用意する。 /// </summary> private void InitializeImageList() { _defaultImage = MonoTouch.UIKit.UIImage.FromFile("default.png"); _imageList = new System.Collections.Generic.List<MonoTouch.UIKit.UIImage>(30); int i = 0; while (_imageList.Count < _imageList.Capacity) { MonoTouch.UIKit.UIImage img = MonoTouch.UIKit.UIImage.FromFile("images/" + i + ".jpg"); _imageList.Add(img); ++i; } }
private static byte[] DoImgConvert(byte[] data, ref TXlsImgType imgType) { using (MemoryStream DataStream = new MemoryStream(data)) { using (MemoryStream Result = new MemoryStream()) { using (Image Img = ImageExtender.FromStream(DataStream)) { Img.Save(Result, ImageFormat.Png); imgType = TXlsImgType.Png; return(Result.ToArray()); } } } }
public static Image GetImage(Stream aStream) { if (MissingFrameworkImageFromStream) { return(null); } try { Image Result = DoGetImage(aStream); return(Result); } catch (MissingMethodException) { MissingFrameworkImageFromStream = true; //Nothing. } catch (ArgumentException) { FlxMessages.ThrowException(FlxErr.ErrInvalidImage); } return(null); }
public CoverImage(MonoTouch.UIKit.UIImage image) { _height = image.Size.Height; _image = ImageUtils.AddImageReflection(image, kReflectionFraction); }
internal static Image FromStream(Stream St) { return(Image.FromStream(St)); }
internal static int Width(this Image Img) { return(Img.Width); }
internal static int Height(this Image Img) { return(Img.Height); }