Inheritance: ImageBase
コード例 #1
0
ファイル: ImageBase.cs プロジェクト: IllidanS4/AlbLib
 public bool ExtractLight(out RawImage exported)
 {
     byte[] res = new byte[ImageData.Length];
     bool success = false;
     for(int i = 0; i < res.Length; i++)
     {
         byte b = ImageData[i];
         if(b >= 192)
         {
             res[i] = b;
             success = true;
         }
     }
     exported = new RawImage(res, GetWidth(), GetHeight());
     return success;
 }
コード例 #2
0
 /// <summary>
 /// Loads all images.
 /// </summary>
 public static void Load()
 {
     images = new RawImage[infos.Length];
     using(FileStream stream = new FileStream(Paths.Main, FileMode.Open))
     {
         for(int i = 0; i < infos.Length; i++)
         {
             ImageLocationInfo info = infos[i];
             if(stream.Position != info.Position)
             {
                 stream.Seek(info.Position, SeekOrigin.Begin);
             }
             images[i] = new RawImage(stream, info.Width, info.Height);
         }
     }
 }
コード例 #3
0
ファイル: GraphicPlane.cs プロジェクト: IllidanS4/AlbLib
 /// <summary>
 /// Creates graphic plane with predefined background.
 /// </summary>
 /// <param name="width">
 /// Width of graphic plane.
 /// </param>
 /// <param name="height">
 /// Height of graphic plane.
 /// </param>
 public GraphicPlane(int width, int height)
     : this()
 {
     Background = new RawImage(new byte[width*height], width, height);
 }
コード例 #4
0
ファイル: IconGraphics.cs プロジェクト: IllidanS4/AlbLib
 private static RawImage[] LoadTileset(int index)
 {
     int fx, tx;
     if(!Common.E(index, out fx, out tx))return null;
     using(FileStream stream = new FileStream(Paths.IconGraphicsN.Format(fx), FileMode.Open))
     {
         XLDNavigator nav = XLDNavigator.ReadToIndex(stream, (short)tx);
         int len = nav.SubfileLength;
         RawImage[] tileset = new RawImage[len/256];
         for(int i = 0; i < len/256; i++)
         {
             tileset[i] = new RawImage(nav, 16, 16);
         }
         return tileset;
     }
 }