예제 #1
0
 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++;
 }
예제 #2
0
 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;
 }
예제 #3
0
파일: Texture.cs 프로젝트: liwq-net/liwq718
 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++;
 }
예제 #4
0
 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;
 }