public void Dispose() { if (!IsRefreshable) { return; } if (StandardBitmap != null) { StandardBitmap.Dispose(); StandardBitmap = null; } if (TransparentBitmap != null) { TransparentBitmap.Dispose(); TransparentBitmap = null; } if (TextureBitmap != null) { TextureBitmap.Dispose(); TextureBitmap = null; } DisposeCache(); DisposeOpaqueCache(); DisposeSourceCache(); DisposeOpaqueSourceCache(); DisposeTextureCache(); }
private void CreateStandardImage(string PaletteDataPath) { StandardBitmap = SetPaletteColors(BitmapExtensions.LoadBitmap(Filename), PaletteDataPath); if (StandardBitmap.Palette != null && StandardBitmap.Palette.Entries.Length > 0) { StandardBitmap.MakeTransparent(StandardBitmap.Palette.Entries[0]); } else { StandardBitmap.MakeTransparent(SystemColor.FromArgb(0xff00ff)); } }
private void CreateTransparentImage() { TransparentBitmap = StandardBitmap.Clone(new Rectangle(0, 0, StandardBitmap.Width, StandardBitmap.Height), PixelFormat.Format32bppArgb); if (TransparentBitmap.Palette != null && TransparentBitmap.Palette.Entries.Length > 0) { TransparentBitmap.MakeTransparent(TransparentBitmap.Palette.Entries[0]); } else { TransparentBitmap.MakeTransparent(SystemColor.FromArgb(0xff00ff)); } TransparentBitmap = SetImageOpacity(TransparentBitmap, SemiOpacity); }