예제 #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);
 }