コード例 #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
ファイル: Factory.cs プロジェクト: liwq-net/UIFactory
 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
ファイル: UIFactory.cs プロジェクト: liwq-net/UIFactory
 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;
 }