public Texture(string filename) { liwq.PngDecoder png = new liwq.PngDecoder(); byte[] pixels = png.Decode(System.IO.File.OpenRead(filename)); this.Texture2D = new Texture2D(Application.SharedApplication.GraphicsDevice, png.Width, png.Height, false, SurfaceFormat.Color); this.Texture2D.SetData <byte>(pixels); this.Name = _Name++; }
public static Cocos2D.CCTexture2D CreateTexture(Stream stream) { PngDecoder png = new PngDecoder(); byte[] colors = png.Decode(stream); CCTexture2D cctexture = new CCTexture2D(); cctexture.InitWithRawData<byte>(colors, Microsoft.Xna.Framework.Graphics.SurfaceFormat.Color, png.Width, png.Height, false); return cctexture; }
public Texture(string filename) { liwq.PngDecoder png = new liwq.PngDecoder(); byte[] pixels = png.Decode(System.IO.File.OpenRead(filename)); this.Texture2D = new Texture2D(Application.SharedApplication.GraphicsDevice, png.Width, png.Height, false, SurfaceFormat.Color); this.Texture2D.SetData<byte>(pixels); this.Name = _Name++; }
public static Texture2D XnaTextureFromPng(Stream pngStream) { PngDecoder decoder = new PngDecoder(); byte[] colors = decoder.Decode(pngStream); Texture2D xnaTexture = XnaTexture(decoder.Width, decoder.Height); xnaTexture.SetData<byte>(colors); return xnaTexture; }