3 #if SILICONSTUDIO_PLATFORM_IOS
7 using System.Runtime.InteropServices;
8 using MonoTouch.CoreGraphics;
9 using MonoTouch.Foundation;
10 using MonoTouch.UIKit;
11 using SiliconStudio.Core;
13 namespace SiliconStudio.
Paradox.Graphics
18 partial class StandardImageHelper
20 public static Image LoadFromMemory(IntPtr pSource,
int size,
bool makeACopy, GCHandle? handle)
22 using (var imagedata = NSData.FromBytes(pSource, (uint) size))
23 using (var cgImage =
new UIImage(imagedata).CGImage)
25 var image = Image.New2D(cgImage.Width, cgImage.Height, 1, PixelFormat.R8G8B8A8_UNorm, 1, cgImage.BytesPerRow);
27 using (var context =
new CGBitmapContext(image.PixelBuffer[0].DataPointer, cgImage.Width, cgImage.Height, 8, cgImage.Width*4, cgImage.ColorSpace, CGBitmapFlags.PremultipliedLast))
29 context.DrawImage(
new RectangleF(0, 0, cgImage.Width, cgImage.Height), cgImage);
34 Utilities.FreeMemory(pSource);
41 public static void SaveGifFromMemory(PixelBuffer[] pixelBuffers,
int count, ImageDescription description, Stream imageStream)
43 throw new NotImplementedException();
46 public static void SaveTiffFromMemory(PixelBuffer[] pixelBuffers,
int count, ImageDescription description, Stream imageStream)
48 throw new NotImplementedException();
51 public static void SaveBmpFromMemory(PixelBuffer[] pixelBuffers,
int count, ImageDescription description, Stream imageStream)
53 throw new NotImplementedException();
56 public static void SaveJpgFromMemory(PixelBuffer[] pixelBuffers,
int count, ImageDescription description, Stream imageStream)
58 throw new NotImplementedException();
61 public static void SavePngFromMemory(PixelBuffer[] pixelBuffers,
int count, ImageDescription description, Stream imageStream)
63 throw new NotImplementedException();
66 public static void SaveWmpFromMemory(PixelBuffer[] pixelBuffers,
int count, ImageDescription description, Stream imageStream)
68 throw new NotImplementedException();
_In_ size_t _In_ size_t size
SiliconStudio.Core.Mathematics.RectangleF RectangleF