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); }
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); }
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); }
public LargeIcon(BinaryReader br) { Bytes = br.ReadBytes(0x1200); Icon = BCLIM.getIMG(48, 48, Bytes, 0x5); }
public SmallIcon(BinaryReader br) { Bytes = br.ReadBytes(0x480); Icon = BCLIM.getIMG(24, 24, Bytes, 0x5); }