コード例 #1
0
        public static Image makeBMP(string path, bool autosave = false, bool crop = true)
        {
            BCLIM bclim = analyze(path);

            if (bclim.Magic != 0x4D494C43)
            {
                System.Media.SystemSounds.Beep.Play();
                return(null);
            }

            Bitmap img = bclim.GetBitmap(crop);

            if (img == null)
            {
                return(null);
            }
            if (crop)
            {
                img = ImageUtil.CropBMP(bclim, img);
            }
            if (autosave)
            {
                img.Save(Path.Combine(bclim.FilePath, $"{bclim.FileName}.png"));
            }
            return(img);
        }
コード例 #2
0
 public bool ChangeIcon(Bitmap img)
 {
     if (img.Width != Icon.Width || img.Height != Icon.Height)
     {
         return(false);
     }
     Icon  = img;
     Bytes = BCLIM.getPixelData(Icon, 0x5);
     return(true);
 }
コード例 #3
0
        public static BCLIM analyze(byte[] data, string shortPath)
        {
            BCLIM bclim = new BCLIM(data)
            {
                FileName  = Path.GetFileNameWithoutExtension(shortPath),
                FilePath  = Path.GetDirectoryName(shortPath),
                Extension = Path.GetExtension(shortPath)
            };

            return(bclim);
        }
コード例 #4
0
 public LargeIcon(BinaryReader br)
 {
     Bytes = br.ReadBytes(0x1200);
     Icon  = BCLIM.getIMG(48, 48, Bytes, 0x5);
 }
コード例 #5
0
 public SmallIcon(BinaryReader br)
 {
     Bytes = br.ReadBytes(0x480);
     Icon  = BCLIM.getIMG(24, 24, Bytes, 0x5);
 }